I’m newer in T-SQL.So maybe my question will seem naive.
I need to retrieve current date with help of TSQL query.
I can implement this by GETDATE() function but the function
returns me this format 04-03-2012 13:58:02,
I need to get only the date without hour minute and seconds.
Any idea how to do this?
Thank you in advance.
This will remove the time from the
datetimeobject. Therefore it will be in the format04-03-2012 00:00:00If you wish to not send any time back at all, then this is not strictly a
datetimeobject, and you should pass it as a string:Personally however, I would always send back the value as a
datetimeobject, and then format the date at application level. Once a date is converted to a string, its bad practice to try and convert this back to a date, and could cause you problems later down the line.