Hi,
It's been a while since I did any work in access, but you can try something
like this:
...
  ORDER BY year(moment) & '/' & month(moment) & '/' & day(moment) DESC, ...

SQL Server / TSQL allows you to cast a date into a format without the time.
Off the top of my head, I believe the format would be:

ORDER BY cast(moment,102)

Of course, access has some limitations in its tsql support.

If you drop by the msdn.microsoft.com, they have complete documentation of
what is and is not supported.

Geoff B


-----Original Message-----
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Friday, September 12, 2003 11:56 AM
To: CF-Talk
Subject: Re: grouping a query on date


Thanks,

Ok, I manage to get this:

SELECT  year(moment) & month(moment) & day(moment) AS theDay, ...
  FROM theTable
  WHERE moment > #createODBCDate(Now()-15)#
  GROUP BY year(moment) & month(moment) & day(moment), ...
  ORDER BY year(moment) & month(moment) & day(moment) DESC, ...

And it almost works. The problem is that these functions generate only one
digit values between 1 and 9, the the sorting is not correct. I get 200398
instead of 20030908.
Is there a way I can format them on two digits?

The problem also is to find where such functions are documented.
- They are not in my SQL book (not standard functions).
- They are not in the Access documentation,
- I have 3 books about Access, including one well documented about SQL
specificities in
  Access, but none of them says a sinble word about functions one may call
in SQL



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to