SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Converting date format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

w1102157
Yak Posting Veteran

80 Posts

Posted - 06/15/2012 :  04:50:23  Show Profile  Reply with Quote
hi Guys

how do I covert a date format of yyyy-mm-dd hh:mm:ss to dd/mm/yyyy using a simple convert?

Villanuev
Constraint Violating Yak Guru

311 Posts

Posted - 06/15/2012 :  05:12:38  Show Profile  Reply with Quote
Try this. hope this will help you.

Select CONVERT(DATE,GETDATE(),101) AS DateOnly

OR


Select CONVERT(VARCHAR(10),GETDATE(),101) AS DateOnly

Edited by - Villanuev on 06/15/2012 05:15:47
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 06/15/2012 :  05:13:14  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
convert(varchar(10),dte,103)

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47189 Posts

Posted - 06/15/2012 :  15:58:19  Show Profile  Reply with Quote
I will try to do it at front end if at all possible before doing this in sql

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.17 seconds. Powered By: Snitz Forums 2000