I need to specify a date value in a sybase where clause. For example:
select *
from data
where dateVal < [THE DATE]
Use the convert function, for example:
select * from data
where dateVal < convert(datetime, '01/01/2008', 103)
Where the convert style (103) determines the date format to use.
Here's a good reference on the different formatting you can use with regard to the date:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38151.1510/html/iqrefbb/Convert.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With