I have a datetime field in a database, but want to query on the date
portion only.
1. Can someone provide an example?
2. Any good online SQL resources specific to MSSQL dialect?
Thank you,
--
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."1. Can someone provide an example?
Sure, SELECT CONVERT(VARCHAR(10),GETDATE(),112) --Look in the BOL for
more information about Convert.
2. Any good online SQL resources specific to MSSQL dialect?
Sure, look in the BOL for more information: http://www.aspfaq.com/2229
HTH, jens Suessmeyer.|||Datetime to Date =>
This will work,
SELECT getdate()
SELECT CAST(FLOOR(CAST( getdate() AS float)) AS DATETIME)
For MSSQL dialect, look BOL
Thanks,
Sree
"Lee" wrote:
>
> I have a datetime field in a database, but want to query on the date
> portion only.
> 1. Can someone provide an example?
> 2. Any good online SQL resources specific to MSSQL dialect?
> Thank you,
> --
> Warm Regards,
> Lee
> "Upon further investigation it appears that your software is missing
> just one thing. It definitely needs more cow bell..."
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment