Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts
    I am creating a database to monitor our oral chemotherapy patients. I am trying to write a query that will let me create a report to tell me if it has been 30 days or more since the prescription was last filled. Will this: <=DateValue(Now())-30 perform the function I need? I'm having trouble understanding some of the function lanquage and want to make sure I am on the right path.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Even simpler:

    <Date()-30

    Date() returns today's date, and 30 subtracts 30 days from it (Access stores dates as a number with 1 day as unit).

  3. #3
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='791493' date='31-Aug-2009 11:29']Even simpler:

    <Date()-30

    Date() returns today's date, and 30 subtracts 30 days from it (Access stores dates as a number with 1 day as unit).[/quote]

    Well, what do you know. For once I made it harder than it needed to be! Thanks once again.

    So, if I want 30 days or less, do I do <=Date()-30 or do I use <Date()-29?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='kyhawkeye' post='791494' date='31-Aug-2009 17:38']So, if I want 30 days or less, do I do <=Date()-30 or do I use <Date()-29?[/quote]
    Both mean "30 days or more ago" - you can use whichever you prefer.
    If you really want "30 days or less ago", use >=Date()-30 or >Date()-31

  5. #5
    Star Lounger
    Join Date
    May 2003
    Location
    Whitmore Lake, MI , USA
    Posts
    84
    Thanks
    13
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='791497' date='31-Aug-2009 11:41']Both mean "30 days or more ago" - you can use whichever you prefer.
    If you really want "30 days or less ago", use >=Date()-30 or >Date()-31[/quote]

    Didn't know if one worked better than the other. Thanks!

Posting Permissions

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