Results 1 to 4 of 4
  1. #1
    JRCharlie's Avatar
    JRCharlie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    20

    Iff Statement

    Hi all
    I have a query with the following columns Fname, Laname, Adress, Orderdate, ConfirmeDate, Stock.
    The ConfirmDate has a Date Value, Stock is a yes/no .
    I would like to display all orders where ConfirmDate is null or If ConfirmDate is not null the Stock must be Checked.
    Can some one help writing this Iff Statement.
    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try:

    SELECT * FROM tablename WHERE ConfirmDate Is Null OR Stock=True;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JRCharlie's Avatar
    JRCharlie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    20
    Thanks June 7 for your quick reply.
    Your tip put me in the right direction but what I really wanted was:
    SELECT * FROM tablename WHERE ConfirmDate Is Null Or ConfirmDate Is Not Null And Stock=True;

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Probably need grouping parens:

    SELECT * FROM tablename WHERE ConfirmDate Is Null Or (ConfirmDate Is Not Null And Stock=True);
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  2. IIf statement
    By Rhubie in forum Access
    Replies: 14
    Last Post: 08-31-2012, 03:37 PM
  3. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  4. If Statement Help
    By vennies83 in forum Queries
    Replies: 1
    Last Post: 06-09-2011, 03:50 PM
  5. If Then Statement Help
    By Kapelluschsa in forum Programming
    Replies: 5
    Last Post: 08-11-2010, 09:24 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