• Criteria from Calculated Fields (Access 2K3)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Criteria from Calculated Fields (Access 2K3)

    Author
    Topic
    #427574

    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!!!

    Viewing 0 reply threads
    Author
    Replies
    • #991065

      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.

      • #991159

        Beautiful.

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

    Viewing 0 reply threads
    Reply To: Criteria from Calculated Fields (Access 2K3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: