I have a query that selects dates from a datasource, and I would like to
order by the number of days to the next occurrence, but the following
doesn't work.
SELECT Date
FROM Dates
ORDER BY #DateDiff(date, now())#
The only way I can think of doing it would be to query the dates, do the CF
calculations, then insert the results into a new column and order by that.
ie...
SELECT Date
FROM Dates
insert into dates (datediff)
values (#datediff(date, now())#)
SELECT Date, DateDiff
FROM Dates
ORDER BY DateDiff
Can anyone come up with a solution that doesn't require 3 queries? (and yes
I know I have missed the WHERE clause etc.... this is just an example of the
code to keep the mail short.
--
James Smith
[EMAIL PROTECTED]
When God created France he found it so perfect that to comfort those who
couldn't live there, he created the French.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.