Hosea 8/1/2011 6:19:57 PM

Casting and Converting Date Values

The msdn article on Cast an Convert is perfectly clear when it comes to how Cast and Convert manipulate the date values into text.

http://msdn.microsoft.com/en-us/library/ms187928.aspx

But… it’s just a little bit easier to see it printed out. Here’s a short script that prints out all the different CASTS that are possible and give an example. ‘127’ is in the SQL 2008 R2 documentation but failed against the SQL 200 server I was testing on, so I commented it out.

Version: Unknown or N/A
Section: SQL Scripts


Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3