DWUTKA at marlow.com
DWUTKA at marlow.com
Fri Apr 2 09:45:53 CST 2004
Because Format() returns a string, so you are telling it to SORT by a string, not a date. Your ORDER BY line should just have [TblArbo].[Datum]. Keep the Format in the SELECT line, and you should be good to go. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of S D Sent: Friday, April 02, 2004 1:06 AM To: accessd Subject: [AccessD] ORDER BY BUG using Date format AARHG Hi group, I've got a combobox based on a query: SELECT DISTINCT [TblArbo].[Datum] FROM TblArbo ORDER BY [TblArbo].[Datum] DESC; Resulted in: 01-10-2003 02-09-2003 21-08-2001 The user asked if this could be printed in the following format: dd-mmm-yyyy No problem, says stupid me: SELECT DISTINCT Format([TblArbo].[Datum],"dd-mmm-yyyy") FROM TblArbo ORDER BY Format([TblArbo].[Datum],"dd-mmm-yyyy") DESC; But now the ORDER BY ONLY checks the DD part?!?!?!?! So this results in: 21-08-2001 02-09-2003 01-10-2003 ?!!??! What kind of nonsense is this? Sander --------------------------------- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com