General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>Is it possible to subtract 2 dates in ANSI SQL92 and get a number of days, months, or years? What is the syntax?
>
>Cindy,
>
>I've not been able to locate any kind of documentation about pure ANSI SQL. If you find something, please forward it to me.
>
>Try using DATEDIFF(part, startdate, enddate). I'm not sure if it's specific to SQL Server or not.
>
>WHERE DATEDIFF(year, dDOB, dDischargeDate) > 18
>
>I'm not making any promises...
>
>-Mike
DATEDIFF is a no-go for ANSI SQL.
I have an interesting book where a lot of SQL functions from various platforms are listed, and DATEDIFF is not listed!
(Wayne S. Freeze, SQL Programmers Reference)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only