Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Posts
    59

    Unanswered: Wildcards in dates

    I use the following as part of a macro to display or hide a label depending on the time of year.
    Between #01-Jan-02# And #06-Jan-02#
    Is it possible to use a wildcard for the year part so that one does not have to include such lines for each year like 03, 04, 05 etc?
    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, you can "wildcard" the year, but not in the manner you expect

    since dates are not stored as strings but rather as integers, you have to use date functions to extract the month and day

    in your example,

    where month(yourdate)=01
    and day(yourdate) between 01 and 06

    by not mentioning the year, you have effectively "wildcarded" it

    it gets trickier when you want to check, say, a date between january 30 and february 2 --

    where ( month(yourdate)=01
    and day(yourdate) >= 30 )
    or ( month(yourdate)=02
    and day(yourdate) <= 02 )

    rudy
    http://rudy.ca/

  3. #3
    Join Date
    Jun 2002
    Posts
    59
    Rudy,

    Thanks - working perfectly

    Frank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •