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 2000 Forums
 SQL Server Development (2000)
 Date Format

Author  Topic 

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-06 : 12:45:04
Does anyone know what the syntax is to format a date to the mmddyyyy format in a SELECT Statement?

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-06 : 12:52:58
You have to write some code to do it, here's a pretty simple way

replace(convert(varchar(10), thedate, 101), '/', '')


For example

select replace(convert(varchar(10), getdate(), 101), '/', '')
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-06 : 17:56:30
Thanks, That worked!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-06 : 19:52:55
If you use front end application, then you should format it there

Madhivanan

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

- Advertisement -