Useful SQL Functions.

This page is really a cheat sheet for functions I use regularly and forget just as regularly.

MSSQL

mm/dd/yyyy format for dates: CONVERT(VARCHAR(10), GETDATE(), 103) AS [DD/MM/YYYY] (thanks to http://www.sql-server-helper.com/tips/date-formats.aspx – also has many other formats)

Decimal format for currency: convert(decimal(18,2), 23.234,0), though if possible it is easier to get the format correct with use of proper declaration of variables in the first place.

About Simeon Cheeseman

I enjoy a wide variety of computer and board games, have a BSc in Computer Science and have played percussion for 18 years.

Posted on July 26, 2011, in Database. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: