The different between two function is:
When you use CAST, it change the DATETIME value to the type of data that you specified
For example:
SELECT CAST(GETDATE() AS VARCHAR(23)) --RETURNS 'Jan 1 2011 10:48PM'But when you use CONVERT function, you can change the date format
SELECT CONVERT(VARCHAR(23), GETDATE(), 103) --RETURNS 01/01/2011103 here is the default format style

8:02 AM
1 comment