Subtraction of dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Parul Bagadia
    New Member
    • Mar 2008
    • 188

    Subtraction of dates

    For certain purpose ; i need to subtract two dates in sql can i directly write a sign of subtraction or will i have to do sth else?
  • Parul Bagadia
    New Member
    • Mar 2008
    • 188

    #2
    may be we can convert it in number and subtract?
    Is there any function of that kind?
    M new in sql... can someone tell me?

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Just use - . The value given is the number of days.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        since date stores time inforamtions as well, it is better to TRUNC() the date and then substract.

        Comment

        Working...