Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Simple Convert function question
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

12 Posts

Posted - 03/04/2013 :  21:57:33  Show Profile  Reply with Quote
I have a simple select statement like:
Select FN, LN, DateApplied as ApplicationDate from MyTable

I am trying to use the Convert function on ApplicationDate to format it to mm/dd/yyyy so that the output is a little prettier.

How and where do I insert the Convert function in the Select statement? The 101 format string is OK.



Very Important crosS Applying yaK Herder

52326 Posts

Posted - 03/04/2013 :  22:44:44  Show Profile  Reply with Quote
you should be trying to do this at front end as applying convert will make date fields come as varchar which can affect results later if you're doing some further manipulations with date like sorting etc

If you really want to do this in t-sql, use

Select FN, LN, convert(varchar(11),DateApplied,101) as ApplicationDate from MyTable

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000