Date problems

  • Hi Folks,

    I am having a problem where I want to return the current date and time in two columns without any formatting,

    eg:

    CurrentDate CurrentTime

    20070418 1222

    Is there an easy way to do this?

    All help is gratefully recieved!! Thanks in advance

    Cheers

    Morrislgn

  • SELECT

      CONVERT(VARCHAR, CURRENT_TIMESTAMP, 112),

            STUFF(CONVERT(VARCHAR(5), CURRENT_TIMESTAMP, 108), 3, 1, '')

     


    N 56°04'39.16"
    E 12°55'05.25"

  • Excellent - thanks very much!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply