TorrediPisa
Programmer
Hello
I have the following SQL statement in which I calculate the number of days between two Dates (Date1 and Date2):
I want to order the resultset by this number.
If I make:
SELECT FIELD1, FIELD2, DATE1, DATE2,
datediff('d',DATE1,DATE2) as DELAY_DAYS
ORDER BY DELAY DAYS.
I receive an error.
But if I make:
ORDER BY datediff('d',DATE1,DATE2)
It works.
Do you know if there is another way to do that?
Thanks for yr attention.
Regards
TdP
I have the following SQL statement in which I calculate the number of days between two Dates (Date1 and Date2):
I want to order the resultset by this number.
If I make:
SELECT FIELD1, FIELD2, DATE1, DATE2,
datediff('d',DATE1,DATE2) as DELAY_DAYS
ORDER BY DELAY DAYS.
I receive an error.
But if I make:
ORDER BY datediff('d',DATE1,DATE2)
It works.
Do you know if there is another way to do that?
Thanks for yr attention.
Regards
TdP