Friday, March 23, 2012

query format date

Hi
I wrote query to get date from database SQL 2000 server. Sometime I get different date format not MMDDYYYY but number as Julian calendar? Do you know what wrong with this? How can I wrote SQL so that all date will be MMDDYYYY?

Thanks

Daniel

Try:

select replace(convert(varchar(10), [date_col], 101), '/', '') as [mmddyyyy]

from your_table

AMB

No comments:

Post a Comment