1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    747
    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,283
    Likes Received:
    364
    Trophy Points:
    83
    Moved to DB forum
     

Share This Page