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
 how to get date from database in dd/mm/yyyy format

Author  Topic 

anilr499
Starting Member

18 Posts

Posted - 2012-05-11 : 00:41:03
how to get date from database in dd/mm/yyyy format....

in my database my dat is in this (ddmmmyyyy)"18 Jul 2011" format....

how can i select the date in (dd/mm/yyyy)"18/07/2011" this format...

eg:

in database: 18 Jul 2011
required format: 18/07/2011

thank you

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-05-11 : 07:21:12
[code]
Here we go
declare @a date
set @a = '18 Jul 2011'

select CONVERT(varchar(20),@a,103)[/code]
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2012-05-11 : 09:05:31
Return the datatime VALUE from SQL Server and simply format it at your presentation layer (report, SSIS package, application, etc)

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -