SQL to get date from datetime field

Discussion in 'Database' started by Saloni Upadhyay, Jan 13, 2010.

  1. Saloni Upadhyay

    Saloni Upadhyay New Member

    Joined:
    Jan 13, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    select convert(varchar,Datecolumn,101)
    where
    101 ->mm/dd/yyyy
    108 ->hh:mm:ss
    103 ->dd/mm/yyyy

    Function for getting current date in sql --> getdate()
     
  2. SpOonWiZaRd

    SpOonWiZaRd Know what you can do.

    Joined:
    May 30, 2007
    Messages:
    746
    Likes Received:
    8
    Trophy Points:
    0
    Occupation:
    Network Engineer/Programmer
    Location:
    South Africa
    Welcome to G4E, is that a question?
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved to DB forum
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice