Question : Sorting by Activity Date in Ascending Order

Below is a SQL statement I use to generate a sub-report in Access 2003.  I would like for it to sort ascending by Activity Date.  Can anyone assist?  Thanks.


SELECT DISTINCTROW [CA_Activity].[ActivityDate], [CA_Activity].[CA_NO], [CA_Activity].[Avtivity] FROM [CA_Activity];

Answer : Sorting by Activity Date in Ascending Order

did you try:

SELECT DISTINCTROW [CA_Activity].[ActivityDate], [CA_Activity].[CA_NO], [CA_Activity].[Avtivity] FROM [CA_Activity] ORDER BY [CA_Activity].[ActivityDate];

for proper sorting, the data type of activitydate must be date, or if it's text, the format of the value must be yyyy-mm-dd, for example.
Random Solutions  
 
programming4us programming4us