Aaaarrrrggggghhhhh - Date Sort
SOS!
I'm trying to sort a date in a query but it's being sorted alphabetically instead. The query is linked to an excel file via a table. In the excel file, the cell format is set as date format but once I grouped the table by month (via query), it's converted to text (that what I think is happening).
This is the SQL:
SELECT DISTINCTROW [T: 1018].[Material Number], [T: 1018].[Material Description], Format$([T: 1018].[Date],'mmmm yyyy') AS [Date By Month], [T: 1018].Type, Sum([T: 1018].Total) AS [Sum Of Total], Sum([T: 1018].Value) AS [Sum Of Value]
FROM [T: 1018]
GROUP BY [T: 1018].[Material Number], [T: 1018].[Material Description], Format$([T: 1018].[Date],'mmmm yyyy'), [T: 1018].Type, Year([T: 1018].[Date])*12+DatePart('m',[T: 1018].[Date])-1
HAVING ((([T: 1018].Type)="Ethylene"));
Appreciate it if u could give a thorough explaination and solution as I not that good with access or SQL.
SOS!
I'm trying to sort a date in a query but it's being sorted alphabetically instead. The query is linked to an excel file via a table. In the excel file, the cell format is set as date format but once I grouped the table by month (via query), it's converted to text (that what I think is happening).
This is the SQL:
SELECT DISTINCTROW [T: 1018].[Material Number], [T: 1018].[Material Description], Format$([T: 1018].[Date],'mmmm yyyy') AS [Date By Month], [T: 1018].Type, Sum([T: 1018].Total) AS [Sum Of Total], Sum([T: 1018].Value) AS [Sum Of Value]
FROM [T: 1018]
GROUP BY [T: 1018].[Material Number], [T: 1018].[Material Description], Format$([T: 1018].[Date],'mmmm yyyy'), [T: 1018].Type, Year([T: 1018].[Date])*12+DatePart('m',[T: 1018].[Date])-1
HAVING ((([T: 1018].Type)="Ethylene"));
Appreciate it if u could give a thorough explaination and solution as I not that good with access or SQL.