Results 1 to 4 of 4
  1. #1
    Stho176 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    2

    I need help with a IIf Statement!

    I am needing help with how to create a statement. I would like to bucket items that should be shipped on a particular date. I created a separate table with the targeted dates: a start date, end date and the Saturday or target date. Say if a item was entered to on 10/8/13 and it will be shipped on 10/12/13; it should appear with a "targeted" Saturday's date. Please review the statement that I have created: Saturday Date: IIf([sch_del_date]>[Start date] And [sch_del_date]<[end date],[saturday],"")

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    The syntax is correct. Can't comment on the logic or the field info of course....

  3. #3
    Stho176 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    2
    Quote Originally Posted by NTC View Post
    The syntax is correct. Can't comment on the logic or the field info of course....

    NTC, thanks for that information! I have attached a screen shot so, maybe this will provide more insight as to what I am trying to do. It works but it is duplicating the information.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    There is no join between the tables. This results in a cartesian relation, every record of each table joins to every record of other table.

    Consider:
    SELECT *, DLookup("saturday", "[tbl Saturday Week Days]", "#" & sch_del_date & "# BETWEEN [Start Date] AND [End Date]") As TargSat FROM [qryOpen Order by District by wk1];

    BETWEEN AND is inclusive for the range ends.

    This could probably be accomplished without the date table. What are the rules that set the start date and end date range as well as selecting the saturday target?
    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. IIf Statement
    By dharsh in forum Access
    Replies: 5
    Last Post: 06-27-2013, 09:39 PM
  2. iif Statement Help
    By smc678 in forum Forms
    Replies: 8
    Last Post: 12-11-2012, 11:02 AM
  3. 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
  4. Replies: 1
    Last Post: 01-13-2012, 02:59 PM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 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