Results 1 to 3 of 3
  1. #1
    jeskit is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3

    query criteria in access 2007

    Hi

    I wanted to know if anyone could tell me if it is possible to create a query where the criteria has a where clause?

    I want to add criteria to a query i am writing which looks for any row which is <= the date column of table 3, however when the criteria looks at table 3 for the date, i only want it to look at the row with 1 in the Id column.

    So basically i need the criteria to do something like <= table3.date where table3.id = 1

    Is this possible? If not is there any way of doing it?

    Thank you



    jeskit

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    I'm not conversant in SQL so I get around this by designing two

    queries, with one based on the other. If you need the SQL, go to the SQL view and copy it.
    In other words, construct a query which returns only records where the ID = 1. Then base the other query on that one.

  3. #3
    jeskit is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3
    hi,

    not really what i have is the following query:

    Code:
    SELECT Post.AppRefID, Post.Item, Post.DateRqd, Post.DateChased, Post.DateRcd, AppChecklist.FirstName, AppChecklist.AppName, AppChecklist.AppRcd, AppChecklist.IFA_FSA
    
    FROM ChasingReport, AppChecklist INNER JOIN Post ON AppChecklist.AppRefID = Post.AppRefID
    
    WHERE (((Post.Item) Like "*await referral*") AND ((IsNull([AppChecklist].[StartDate]))=True) AND ((([Post].[DateChased])+21)<=[ChasingReport]![Date]) AND ((IsNull([Post].[DateRcd]))=True) AND ((IsNull([AppChecklist].[AppClosed]))=True)) OR (((Post.Item) Like "*await referal*") AND ((IsNull([AppChecklist].[StartDate]))=True) AND ((([Post].[DateChased])+21)<=[ChasingReport]![Date]) AND ((IsNull([Post].[DateRcd]))=True) AND ((IsNull([AppChecklist].[AppClosed]))=True)) OR (((Post.Item) Like "*HT/Wt*") AND ((IsNull([AppChecklist].[StartDate]))=True) AND ((([Post].[DateChased])+21)<=[ChasingReport]![Date]) AND ((IsNull([Post].[DateRcd]))=True) AND ((IsNull([AppChecklist].[AppClosed]))=True));
    However i need to chnage this part of the criteria ((([Post].[DateChased])+21)<=[ChasingReport]![Date]) so instead of just <=[ChasingReport]![Date] it only looks at the date in ChasingReports table where the column Id in Chasing Reports is 1

    Does this help? I am sorry i am not good at explaining things in a way otehrs would understand

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-18-2011, 09:55 AM
  2. MS Access 2007 Query Help
    By tjames in forum Queries
    Replies: 2
    Last Post: 12-15-2010, 08:06 AM
  3. Create a query in VBA, Access 2007
    By laavista in forum Access
    Replies: 3
    Last Post: 06-22-2010, 07:43 PM
  4. Excel not using Access query criteria
    By thart21 in forum Queries
    Replies: 10
    Last Post: 04-30-2010, 09:58 AM
  5. Replies: 1
    Last Post: 03-29-2010, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums