quinta-feira, julho 11, 2013

How to format date with getdate() function result

How to format date with getdate() function result:

SELECT replace(convert(varchar, getdate(), 111), '/', '-')  + ' 00:00:00' AS EndDate, replace(convert(varchar, getdate()-1, 111), '/', '-') + ' 00:00:00' AS StartDate


http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/

Sem comentários: