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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Converting date format

Author  Topic 

w1102157
Yak Posting Veteran

80 Posts

Posted - 2012-06-15 : 04:50:23
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

478 Posts

Posted - 2012-06-15 : 05:12:38
Try this. hope this will help you.

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

OR


Select CONVERT(VARCHAR(10),GETDATE(),101) AS DateOnly
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-15 : 05:13:14
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

52326 Posts

Posted - 2012-06-15 : 15:58:19
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
   

- Advertisement -