You can use either CAST or CONVERT. Because CAST and CONVERT provide similar functionality.

The difference is CASE is more ANSI standard and use this only if you are writing a program which you will need to use in many database platforms. Where CONVERT is Microsoft specific and more powerful.

Links:
http://msdn2.microsoft.com/en-us/library/ms187928.aspx
http://searchwinit.techtarget.com/tip/0,289483,sid1_gci1014050,00.html

VN:F [1.1.6_502]
Rating: 4.0/5 (1 vote cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Build DateTime from values
  2. SQL – Convert columns to a row (concatenation)
  3. MD5 with t-sql
  4. Difference between Windows Vista Editions
  5. T-SQL Find previous month