Results 1 to 3 of 3
  1. #1
    TheHarleygirl2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    34

    DateDiff


    I am calculating Longevity in a query using the following formula

    YearsOfService: DateDiff("yyyy",[Service Date],Now())+Int(Format(Now(),"mmdd")<Format([Service Date],"mmdd"))

    This works perfect to calculate based on today's date. However, I would like to change the formula so it will calculate effective December 31st of the current year rather then Now().

    Can anyone help with this?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,952
    DateSerial(Year(Date()), 12, 31)
    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
    TheHarleygirl2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    34
    Thank you! That was exactly what I needed.

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

Similar Threads

  1. Datediff()
    By st1300 in forum Programming
    Replies: 6
    Last Post: 12-08-2011, 05:58 PM
  2. DateDiff
    By mrkaye in forum Forms
    Replies: 18
    Last Post: 11-19-2010, 08:19 AM
  3. DateDiff
    By ROB in forum Access
    Replies: 2
    Last Post: 10-30-2010, 03:58 AM
  4. How to use DateDiff?
    By teirrah1995 in forum Queries
    Replies: 10
    Last Post: 10-19-2010, 12:07 PM
  5. Datediff
    By greggue in forum Queries
    Replies: 2
    Last Post: 08-13-2010, 03:53 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