Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Criteria from Calculated Fields (Access 2K3)

    Hi!

    Having a hard time figuring out a query, and I'm looking for some advice. My query pulls 2 created (calculated) fields:

    LastDate: (SELECT Max(Date) FROM tblUtilProd)

    FirstDate: DateAdd("d",-6,[LastDate])

    (LastDate is "Max" in the Total: field, FirstDate is "Expression")

    Now...I want to put a criteria on the original Date field (from tblUtilProd) as follows:

    Between [FirstDate] And [LastDate]

    Problem: I can't seem to get it to recognize [FirstDate] and [LastDate] as fields to base the criteria on (it prompts for them as variables when the query is run). Is there any way to make this happen?

    Thanks!!!

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

    Re: Criteria from Calculated Fields (Access 2K3)

    Save your query with FirstDate and LastDate, but without the criteria on Date.
    Then create a new query based on the query you just saved, and put the criteria in.

  3. #3
    Star Lounger
    Join Date
    Apr 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Criteria from Calculated Fields (Access 2K3)

    Beautiful.

    As usual, you have proven yourself as an Access wizard. Thank you sir.

Posting Permissions

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