Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2008, 01:03 PM   PM User | #1
tom123
Regular Coder

 
Join Date: Apr 2005
Location: Ireland
Posts: 122
Thanks: 4
Thanked 0 Times in 0 Posts
tom123 is an unknown quantity at this point
DateTime Convert - MSSQL

Hi

I have to retreive data from a column which has a type of Dattime and is in format 'DD-MM-YYYY HH:MM:SS24h'.

I need to get it in format 'MM-DD-YYYY HH:MM:SS24h'

Thanks in advance
tom123 is offline   Reply With Quote
Old 12-16-2008, 10:28 AM   PM User | #2
pcusters
New to the CF scene

 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pcusters is an unknown quantity at this point
I have the same problem. Nobody answer
pcusters is offline   Reply With Quote
Old 12-16-2008, 12:13 PM   PM User | #3
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
you can use the convert function to get the data in your desired format:

select convert(char, getdate(), type)

for available types, check the help on "cast and convert"
Roelf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:38 AM.


Advertisement
Log in to turn off these ads.