Results 1 to 2 of 2
  1. #1
    cthai is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    IF statment criteria??

    Hello -

    I'm completely new to programing in access and i'm running into an issue with an If statement not sure how to go about it -

    i have a table with a million different fields in there -i have separated the fields by doing something like this

    type: IIf([typeclear]="ts" Or [typeclear]="s",1)
    field: IIF([([field1]="ccb" Or [field1]="ssbi-pr",1)

    Now i have a date field called finaldate -

    i want to say something like if type and field1 = to 1 use finaldate.



    how do i go around doing this?

  2. #2
    Join Date
    Mar 2011
    Posts
    15
    You're almost there.

    I think you can simply use brackets and an AND clause:

    Code:
    SELECT IIf( ([typeclear]="ts" Or [typeclear]="s")  AND ([field1]="ccb" Or [field1]="ssbi-pr"), FinalDate, otherChoice)
    FROM yourTable
    where otherChoice is what you want when those things are not true.

    Let us know if that's not what you want.

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

Similar Threads

  1. Search By Criteria - Flexible Criteria Fields
    By lilanngel in forum Access
    Replies: 0
    Last Post: 03-16-2011, 06:25 PM
  2. Criteria for date due
    By Desstro in forum Queries
    Replies: 4
    Last Post: 11-30-2010, 12:54 PM
  3. Want certain criteria to appear on report.
    By kenanselo in forum Reports
    Replies: 4
    Last Post: 01-18-2010, 02:48 PM
  4. Variable Criteria
    By JamesLens in forum Queries
    Replies: 0
    Last Post: 01-02-2009, 04:55 PM
  5. SQL statment structure
    By oss_ma in forum Programming
    Replies: 1
    Last Post: 05-13-2007, 02:08 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