Results 1 to 3 of 3
  1. #1
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69

    Alert for Position ending in 6 months

    Hi there,



    I'm trying to find the right formula to put in a query to show all details for a position that has an end date appointment 6months away from now.

    So basically in human terms:

    (End Date of Appointment-Today) <= 6 months

    So there is less then or equivalent of 6 months between end date of appointment and today. My current formula in the query is:
    =(((DateDiff("m",[End Date of Appointment],Now()))+Int(Format(Now(),"mmdd")<Format([End Date of Appointment],"mmdd"))) Mod 12)<=6

    Would appreciate any help please.
    Thanks,

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Probably need the year in there somewhere. If you don't want any appointment records before today, try:

    [End Date of Appointment] BETWEEN Date() AND Date() + 180

    or

    Format([End Date of Appointment],"yyyymm") BETWEEN Format(Date(),"yyyymm") AND Format(DateAdd("m",6,Date()),"yyyymm")

    Why do you show an = sign at beginning of that expression?
    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
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    Hi June, thanks that makes much more sense now

    End date has to be between now and 6 months from now.

    The = sign was a silly mistake, I was trying to put a formula in without realizing it was prompting for the criteria to "equal" the expression.

    Thanks again for your help

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

Similar Threads

  1. Replies: 3
    Last Post: 02-23-2014, 02:06 PM
  2. Create an alert
    By ellixer in forum Programming
    Replies: 2
    Last Post: 06-13-2011, 08:30 AM
  3. Image as never ending wallpaper
    By 95DSM in forum Database Design
    Replies: 1
    Last Post: 07-30-2010, 10:02 AM
  4. Calculating Beginning and Ending page numbers
    By sabraham in forum Access
    Replies: 3
    Last Post: 01-07-2010, 12:36 PM
  5. Viewing ending zeros in decimal
    By duecesup in forum Reports
    Replies: 0
    Last Post: 12-11-2008, 02:45 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