Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have the same problem. Nobody answer

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    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"
    I am the luckiest man in the world


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •