Need Query to pull specific data for a specific time period and additional items outs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdsbuddy
    New Member
    • Sep 2013
    • 1

    #1

    Need Query to pull specific data for a specific time period and additional items outs

    I'm an intermediate user of Access with a little SQL knowledge. I have a query I need and I'm not sure how to create it.

    I've one field that has 3 choices ... Approved, Denied, Pending. The query I need will need to pull the Approved & Denied for a specific time period. This is prety easy and I have the query doing this already.

    The problem comes in when I need to pull all the pending items that are outside of the time period specified.

    ie: Pull all Approved and Denied for August and pull all Pendings up to the end of August. The pending items may be June, July and August, but I don't want any from September.

    Any help is much appreciated
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    You haven't told us anything about the table structure so a little guess...

    One way I do this for my databases is to do this in three queries, one for each search criteria and then a third for the union:
    1st query is as you have it for the approved/denied
    2nd query would be setup to show the pending as you described.
    3rd would be a union query between the first two.

    Ofcourse, you can write this as all one query SQL.

    Combine the results of several select queries by using a union query (ACC2007/2010)

    Rabbit may have a better method and a few details about the table structure may yield a better solution.

    (Rabbit is my Hero for SQL stuff... ! )
    Last edited by zmbd; Sep 4 '13, 06:03 PM.

    Comment

    Working...