Results 1 to 6 of 6
  1. #1
    willmafingerdo is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    108

    creating a follow up report by date and updating dates

    Hello,


    I need to create a follow up report for X amount of time based off of a given code. I think I might know how to do it but I don't know how to write the IIf statement.

    something like: Followup: iif([FollowUpDate]>=[StartDate],[FollowUpDate]=[StartDate] and [FollowUpDate]=[StartDate]+Dateadd("m",X amount of time,[StartDate]))

    Access will accept the statement but it doesn't work... can anyone offer any input please?
    Thanks!!
    Will

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    An IIF statement has three arguments
    1st argument - Condition to Check: Should result in a TRUE/FALSE calculation
    2nd argument - What to return if TRUE: this cannot do anything other than return some value or calculation
    3rd argument - What to return if FALSE: this cannot do anything other than return some value or calculation

    So, your first argument looks fine. But it looks like you are trying to set some fields equal to some other fields or something in your other arguments. You cannot do that. All you can do is to return a value (though that value can be a calculation).

    If you cannot figure out how to do what you want, please explain to us (in plain English), exactly what this calculation should be doing.

  3. #3
    willmafingerdo is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    108
    Here's what's going on:
    Each record will have a start date, and a follow up date. The follow up date comes from a case code in the file. When the follow up date arrives I need a report of various data from the records to do a follow up on them (name, case num, ect..). Then I need to reset the start date and repeat.

    I was thinking if I used an update query I would be able to reset the original start date to the original follow up date once the day arrives to keep a running start date each time the follow up date comes.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    In an Update Query, the key components are:
    - The criteria (which records are being selected to be updated)
    - The field being updated
    - What it is being Updated to

    See here for an example: http://www.databasedev.co.uk/update_query.html

  5. #5
    willmafingerdo is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    108
    I think i got it started, I have the query that calculates the follow up date
    Click image for larger version. 

Name:	follow up date.jpg 
Views:	6 
Size:	93.9 KB 
ID:	24361

    and everything looks good, this is what it shows when i run it
    Click image for larger version. 

Name:	follow up date display.jpg 
Views:	6 
Size:	119.4 KB 
ID:	24365

    but when i run the update query:
    Click image for larger version. 

Name:	Update qurey follow up date.jpg 
Views:	6 
Size:	26.3 KB 
ID:	24360

    This is what the dates look like after i run the update query 1 time:
    Click image for larger version. 

Name:	dates after update.jpg 
Views:	6 
Size:	125.3 KB 
ID:	24367
    I was wondering if anyone could give me some idea of why it adding extra years to what is given.

  6. #6
    willmafingerdo is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    108
    I got this figured out, I just had to use the dateadd function in the update query and added date()>= [StartDate] to the criteria.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-06-2015, 12:45 PM
  2. Replies: 3
    Last Post: 12-06-2014, 03:59 AM
  3. Replies: 3
    Last Post: 01-01-2014, 01:16 AM
  4. Replies: 1
    Last Post: 10-21-2013, 09:42 AM
  5. Follow up calls, put in automatic date
    By Loish in forum Access
    Replies: 1
    Last Post: 04-08-2010, 03:59 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