Results 1 to 5 of 5
  1. #1
    JTKrol is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    21

    Using the IIF in a form

    I'm sorry for all these simple questions...I haven't done anything with access since windows 95... so I am VERY RUSTY and trying to help out the misses....

    I am using =DateAdd("d",60,[Dateofhire/term] in the Expression Builder to calculate another date field. But have just been told by my misses for that to be correct they have to be either FTHourly or FTSalary employee types (both are yes/no fields)



    Can I use the IIF function to check the value of the [FTHourly] or [FTSalary] fields before it performs this calculation?

    If so what is the syntax if there is a better way to do this I'm open to that too.

    THANK YOU ALL SO MUCH FOR YOUR HELP!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Yes.

    What value(s) are you checking for? What do you want to do if the desired value(s) not encountered?

    What field type are FTHourly and FTSalary - yes/no? Why two yes/no fields? Can both be yes in a record? If not, should be 1 field with two options.
    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
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,935
    =iif([FTHourly] or [FTSalary],DateAdd("d",60,[Dateofhire/term]),0)

    by the way - bad idea to use / in field names

  4. #4
    JTKrol is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    21

    WoW Thank you!

    Quote Originally Posted by Ajax View Post
    =iif([FTHourly] or [FTSalary],DateAdd("d",60,[Dateofhire/term]),0)

    by the way - bad idea to use / in field names
    Thank You I'll change it.

  5. #5
    JTKrol is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    21
    Worked great, I replaced the 0 with Null because the 0 was giving me a funky date and the Null leaves it blank...THANK YOU

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

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