VBdotnet2005
asked on
getdate format
On Getdate(), how can I return it as 2011-11-30 00:00:00.000 instead of
2011-11-30 10:27:06.130?
2011-11-30 10:27:06.130?
Sorry, what I gave you won't work.
Change your data type from dateTime to smalldatetime and that will fix it.
Change your data type from dateTime to smalldatetime and that will fix it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are confusing the output you see in a client tool such as SSMS with reality: Getdate() returns a datetime data type and datetime data types do not have any format.
As everyone else has suggested you can certainly CONVERT the output to a varchar with the format you like, but that is not a datetime value.
CONVERT(char(10), Getdate(), 101)