all groups > sql server (alternate) > september 2004 >
You're in the

sql server (alternate)

group:

convert date to MMDDYYYY


convert date to MMDDYYYY mscgloss NO[at]SPAM yahoo.com
9/20/2004 9:54:07 AM
sql server (alternate):
Hello All,

I can't seem to find an answer to this anywhere else: I need to
convert a datestamp to the following format: MMDDYYYY. I've found
solutions to convert it to many different kids of formats, but not one
that allows me to enter the positions of the month, day and year.
Anyone have any ideas?

Thanks,

Mike
Re: convert date to MMDDYYYY Simon Hayes
9/20/2004 7:53:07 PM

[quoted text, click to view]

Here's one way:

select replace(convert(char(10), getdate(), 101), '/', '')

Alternatively, you could format it in your client application if that makes
sense in your environment.

Simon

AddThis Social Bookmark Button