Results 1 to 3 of 3
  1. #1
    Abena is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    1

    Query with multiple and clauses

    Hi,



    I need immediate assistance updating a field in an Access table based on a specific criteria. For example: [t1]![tdt]>=[t1]![cdt] and<[t1]![f2dt] and[t1]![f1dt] and [t1]![Ddt]. Tdt field should be greater than or equal to cdt field but also less than all the other fields mentioned above. Thank you.

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You have practically already written it.
    You can use multiple Criteria under a field. Just combine them all with the word "AND" between each check.
    Note that each condition needs to be a complete expression. You cannot say "a is less than b and c". You need to say "a is less than b and a is less than c".

    If you run into any trouble, change your query to SQL View and copy and paste your query code here so we can help you modify it.

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    As JoeM stated:
    The structure is like this
    Code:
    [t1]![tdt] >= [t1]![cdt] 
    and
    [t1]![tdt] < [t1]![f2dt] 
    and
    [t1]![tdt] < [t1]![f1dt] 
    and 
    [t1]![tdt] < [t1]![Ddt]

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

Similar Threads

  1. 5 if clauses
    By niklassbordone in forum Access
    Replies: 2
    Last Post: 02-08-2018, 06:34 PM
  2. Replies: 2
    Last Post: 05-21-2017, 05:40 PM
  3. Replies: 1
    Last Post: 05-01-2017, 12:11 PM
  4. Replies: 4
    Last Post: 08-17-2015, 10:04 AM
  5. Creating an SQL query with AND and Or clauses.
    By Johanb26 in forum Queries
    Replies: 2
    Last Post: 07-08-2015, 05:30 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