Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Query criteria (2002)

    Hope all is well....

    I'm trying to use the results of one query as the criteria for another query. However, everytime I do this, Access asks for the parameter value. I've tried make table and every syntax I can think of...any suggestions?

    Thanks

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

    Re: Access Query criteria (2002)

    Could you provide more details about the queries and about what you want to accomplish? "I'm trying to use the results of one query as the criteria for another query" does not give us enough information to go on.

    Thank you.

  3. #3
    New Lounger
    Join Date
    Mar 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Query criteria (2002)

    sorry...

    I have a column with dates in it within a query (1).

    I'm trying to find the most current date in the column by trying to find the maximum date in the column.

    Because of the way the data is, if I use the Max function, it returns the last occurrence of every unique field, where I need the latest date.

    I created another query (2) that just gives me the latest date in the table and I wanted to use the results as a criteria for the first query (1) to return only the results that match the latest date.

    thanks again for the help....

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

    Re: Access Query criteria (2002)

    Possibility 1:

    Set the criteria for the date field to

    (SELECT Max([NameOfDateField]) FROM [NameOfTableOrQuery])

    Possibility 2:

    Create a query that only returns the maximum value of the date field. Its SQL is like that above, without the enclosing parentheses. Save it.
    Next, create a query based on your original query and the query you just saved. Join them on the date field. Add all fields from the original query to the grid.

  5. #5
    New Lounger
    Join Date
    Mar 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Query criteria (2002)

    it worked, thanks for the help....i need to dig more into the sql to gain a better understanding of how to use it with the queries....

    thanks again...

Posting Permissions

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