Subject RE: [firebird-support] Re: Order by (Date minus Date)
Author Svein Erling Tysvær
SELECT P.PeriodName, cast('2008-01-21' as Date) - P.StartDate AS PeriodLength
FROM Periods P
ORDER BY 2 DESC

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of ai_no_kareshi
Sent: 21. januar 2008 08:38
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Order by (Date minus Date)

Gosh, you're right. It does work. My bad. On to the next question,
then. The following query really doesn't work.

SELECT P.PeriodName, ('2008/01/21' - P.StartDate) AS PeriodLength
FROM Periods P
ORDER BY 2 DESC

Could you help me get this working with date literals?



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links