Results 1 to 5 of 5
  1. #1
    p81 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    3

    iif Statement between dates showing duplicate entries

    Hey guys, I have a query that needs to list the fund Name if they fall within the authorized start and end date. If it doesn't, the record should still display "None". When I run the following code it displays the information correctly, however I am also getting multiple date of service entries if the client had authorization during different time periods.

    Example:
    ClientID
    dateofservice Fund startdate endate
    005435 7/14/2011 MAG 7/1/2011 9/4/2011
    005435 7/14/2011 None 9/1/2010 12/1/2010
    005435 7/14/2011 None 12/2/2010 3/2/2011
    005435 7/14/2011 None 1/12/2011 3/11/2011
    005435 7/14/2011 None 3/3/2011 6/3/2011
    005435 7/14/2011 None 9/5/2011 12/5/2011


    Fund: IIf([dateofservice]>=[qryauthtcm].[startdate] And [dateofservice]<=[qryauthtcm].[endate],[fundname],"None")




    Any assistance is greatly appreciated!!




    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    IIF seems to be working. Perhaps your query is selecting multiple records. Could you post your query and some records?

  3. #3
    p81 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    3
    Click image for larger version. 

Name:	qry.jpg 
Views:	6 
Size:	65.8 KB 
ID:	7333
    Here is an image of the query.

    The records returned are displaying a record for each item that is in the qryauthtcm table. I also need it to display "None" or something else if there are no records in qryauthtcm.

  4. #4
    p81 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    3
    I figured it out. The Grouping needs to be changed to Max in order to return a single record. Thanks Orange!!

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

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

Similar Threads

  1. Query not showing all entries
    By HeadGasket in forum Queries
    Replies: 5
    Last Post: 02-09-2012, 05:21 PM
  2. Report showing all entries
    By FrustratedAccess in forum Reports
    Replies: 2
    Last Post: 01-27-2012, 07:47 PM
  3. validation setting for duplicate entries
    By noweyout in forum Forms
    Replies: 1
    Last Post: 02-18-2011, 06:14 AM
  4. Recordset not showing alpha-numeric entries
    By rayhawk in forum Access
    Replies: 9
    Last Post: 10-29-2010, 08:15 AM
  5. Entries in table not showing on form!!!
    By corystemp in forum Access
    Replies: 6
    Last Post: 03-26-2009, 06:30 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