Comparing of dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zelalem
    New Member
    • Nov 2006
    • 19

    Comparing of dates

    Dear sir,

    1. Is there any function used to compare dates in the same way as strings are compared ?
    As in : Date 1= 11/22/2006
    Date 2= 11/23/2006
  • albertw
    Contributor
    • Oct 2006
    • 267

    #2
    Originally posted by Zelalem
    Dear sir,

    1. Is there any function used to compare dates in the same way as strings are compared ?
    As in : Date 1= 11/22/2006
    Date 2= 11/23/2006
    hi

    if (string) "Date 1" (rather no space in variables) is "11/22/2006"
    you can use this directly

    Comment

    • albertw
      Contributor
      • Oct 2006
      • 267

      #3
      Originally posted by albertw
      hi

      if (string) "Date 1" (rather no space in variables) is "11/22/2006"
      you can use this directly
      hi

      2ndly you can use DateDiff

      date0 = "12/03/2006"
      date1 = Format(Date, "dd/mm/yyyy")
      diff = DateDiff("d", date0, date1)

      Comment

      Working...