auk_ie
asked on
Get date without minutes and seconds?
Hello
In a stored proc I want to get todays date in the form dd/mm/yy and compare it against some datgetime fields in my tables how can I do this?
In a stored proc I want to get todays date in the form dd/mm/yy and compare it against some datgetime fields in my tables how can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see the CONVERT function help in BOL for complete list of formats
for the convert function use this as reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_2f3o.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_2f3o.asp
This gives you the date in dd/mm/yy format...
SELECT CONVERT(VARCHAR(10),GETDAT E(),3)
If you want it in dd/mm/yyyy format..you can use
SELECT CONVERT(VARCHAR(10),GETDAT E(),103)
SELECT CONVERT(VARCHAR(10),GETDAT
If you want it in dd/mm/yyyy format..you can use
SELECT CONVERT(VARCHAR(10),GETDAT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.