Results 1 to 8 of 8
  1. #1
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118

    If any of the following are true


    I need to set up a query that will look at A, B, C, and D, and then giv eme results if ANY of those are true

    simple date fields with <Date()-30 code in criteria
    however, all 4 date fields need queried.
    I tried to set up 4 seperate queries, then have a new query look at those 4 for input, but that didnt work. Each individual worked great, but the 'master' wouldnt pull any information at all..

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    what was the sql for each individual query?

  3. #3
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    SELECT [Positive Packets].[1st Pos Notification Date], [Positive Packets].[Case Number]
    FROM [Positive Packets]
    WHERE ((([Positive Packets].[1st Pos Notification Date])<Date()-30));

    That is the SQL to display the records from that field that are older than 30
    then the other query's have the same language replacing 1 for 2,3,4 etc.
    Each one works alone just fine.
    From there I created a 5th Query, to combine the results from the other 4 to one table, and I get SQUAT.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    seems I am too late

  5. #5
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    All this information is coming from one table.
    The tables have a
    first contact
    second contact
    third and fourth, etc

    I would like ONE query to look at all four columns in the table to return ALL records that meet any ONE of the 4 criteria.
    Its easy to make it return something that meets all FOUR, but I want it to show me ALL that meet ONE....
    What is wrong with the code I have entered?

    SELECT [Positive Packets].[1st Pos Notification Date], [Positive Packets].[Case Number]
    FROM [Positive Packets]
    WHERE ((([Positive Packets].[1st Pos Notification Date])<Date()-30));

    the master query that should look at all 4 sub querys has this code
    SELECT [1st notification].[1st Pos Notification Date]
    FROM [1st notification];
    Right now I cant even get it to return results from ONE other query so I havent come close to trying all 4

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by weekend00 View Post
    seems I am too late
    It's not a race weekend. It would be if we were being paid.

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    But I was saying it's lack of information to provide help after steven had provided more details.

  8. #8
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    ok, oddly I have gotten it to work. Not sure what I have done. However, its not correct.
    I need each one in a new record, as of now, its combining records.
    If record 1 meets criteria A, and record 2 meets criteria C, then the query created a result with ONE record with both fields full....
    POOOOOOOP

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

Similar Threads

  1. True, "Wahr" and -1 / 0
    By asearle in forum Programming
    Replies: 5
    Last Post: 08-24-2010, 12:09 PM
  2. Tried and true programs no longer run
    By Seckert in forum Access
    Replies: 0
    Last Post: 04-07-2009, 01:45 PM
  3. True or false
    By tleec in forum Queries
    Replies: 1
    Last Post: 02-01-2008, 10:41 AM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM

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