Results 1 to 3 of 3
  1. #1
    kassem is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    22

    How to set criteria for date field in query wizard for record


    Hi, i have a field called DateOfEstimate and i want the records to show one buisness day before Tomorows date. For Example if tomorow is sep 2. The result for all the records that have a DateOfEstimate on sep 1 will show. If Sep2 if on the monday however, the result should show on the friday because i go by buisness days. Can someone help me figure out what to write in the criteria field.

    I wrote
    Code:
    date()+1
    but this dosent handle the buisness days condition.

  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,931
    Not sure I understand - "one business day before Tomorrows date" - isn't that Today?

    Don't you want to subtract not add days?

    Could DateOfEstimate ever be a Saturday or Sunday?

    Try:

    DateOfEstimate - Nz(Choose(Weekday(DateOfEstimate,vbSaturday),1,2,3 ),1)

    Do you have to consider holidays?
    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
    behnam is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    72
    I figured most of it out, Just stuck on one part.

    Code:
    IIf(..,Date()+4,Date()+1)
    to finish the iff statement you need to somehow specify in the .... location if the Date is on a monday. Do you have any idea how to do that?

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

Similar Threads

  1. Replies: 3
    Last Post: 08-18-2013, 01:15 PM
  2. Replies: 3
    Last Post: 03-07-2013, 02:29 PM
  3. Replies: 6
    Last Post: 12-11-2012, 09:40 PM
  4. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  5. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 AM

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