Retrieving Day, month and Year separately from the date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kalai sundari
    New Member
    • Mar 2007
    • 1

    Retrieving Day, month and Year separately from the date

    can any one of you how to retrieve only the day or month or year value alone from the database when the date is strored in dd/mm/yy format??
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    Use day(), month() or year() SQL system functions, like:
    Code:
    select day('12/20/2006'), month('12/20/2006'), year('12/20/2006')

    Comment

    • Taftheman
      New Member
      • Nov 2006
      • 93

      #3
      Originally posted by kalai sundari
      can any one of you how to retrieve only the day or month or year value alone from the database when the date is strored in dd/mm/yy format??
      Try to google the "DatePart" function to give you more info on this

      Comment

      Working...