Endelm
asked on
MSSQL 2005 - DateTime
Hi,
declare @date datetime
set @date = '2008-01-29 12:01:09.437'
How can I cast @date so it will not contain any time, only contain the date:
'2008-01-29'
Many thanks!!! :)
declare @date datetime
set @date = '2008-01-29 12:01:09.437'
How can I cast @date so it will not contain any time, only contain the date:
'2008-01-29'
Many thanks!!! :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In SQL Server 2008 you can use the DATE type.
If you just want to display a datetime value without a time then do that in your client application or presentation tier. SQL Server does not and cannot control the display formatting of a datetime value.