Murray Brown
asked on
Access equivalent of SQL query
Hi
What would the Access equivalent of the following SQL query be? The main problem is "DATEPART"
SELECT DATEPART(Year, [Transactions].[Transactio n Date]) As Year, DATEPART(Month, [Transactions].[Transactio n Date]) As Month, SUM([Transactions].[Amount ]) As TotalAmount
FROM Transactions
WHERE DATEPART(Year, [Transactions].[Transactio n Date]) = DATEPART(Year,getdate())
AND DATEPART(Month, [Transactions].[Transactio n Date]) = DATEPART(Month, getdate())
GROUP BY DATEPART(Year, [Transactions].[Transactio n Date]), DATEPART(Month, [Transactions].[Transactio n Date])
ORDER BY Year, Month
What would the Access equivalent of the following SQL query be? The main problem is "DATEPART"
SELECT DATEPART(Year, [Transactions].[Transactio
FROM Transactions
WHERE DATEPART(Year, [Transactions].[Transactio
AND DATEPART(Month, [Transactions].[Transactio
GROUP BY DATEPART(Year, [Transactions].[Transactio
ORDER BY Year, Month
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER