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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Date format in Date Type

Author  Topic 

micnie_2020
Posting Yak Master

232 Posts

Posted - 2011-11-25 : 03:19:18
Hi All,

Can i remain the type as date but format must be dd/mm/yyyy

SELECT CONVERT(VARCHAR(10), GETDATE(), 101)

Please advise.

Thank you.

Regards,
Micheale

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-11-25 : 04:06:08
The type Date has its own format.
Your desired format for display has nothing to do with that and you should do it in your front end if possible.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-11-25 : 04:43:28
quote:
Originally posted by micnie_2020

Hi All,

Can i remain the type as date but format must be dd/mm/yyyy

SELECT CONVERT(VARCHAR(10), GETDATE(), 101)

Please advise.

Thank you.

Regards,
Micheale


Why do you worry about formation?
Make sure to read this post
http://beyondrelational.com/blogs/madhivanan/archive/2010/06/03/understanding-datetime-column-part-ii.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -