Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Oct 2001
    Location
    New York
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Formula (Access 97 )

    I need to create a formula to do the following. In my report, under the field [Project], it is required only for cases set for trial dates within 90 days of the date we send the report. The <trialDate> field is in date format. I understand what I need to do but I can't seem to get it right.

    Thanks
    Nadia

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

    Re: Date Formula (Access 97 )

    You must put a where-condition on the record source of the report. The easiest way is to create a query and use the query name as record source, but it's also possible to create an SQL statement to act as record source. The criterion for the Project field must be: Between Date()-90 And Date().

    See attached screenshot of part of the query design grid. The corresponding SQL is<pre>SELECT ... FROM tblProjects WHERE Project Between Date()-90 And Date();</pre>

    Of course, you must substitute the appropriate table name.
    Attached Images Attached Images
    • File Type: png x.png (1.4 KB, 0 views)

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Date Formula (Access 97 )

    Have the trials already happened when you send the report, or are they coming up in the future?

    Hans' answer assumes they have happened.
    Depending on exactly what is happening you might want:

    <pre>WHERE ProjectDate Between Date() And Date()+90 </pre>


    or

    <pre>WHERE ProjectDate Between Date()-90 And Date()+90 </pre>

    Regards
    John



Posting Permissions

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