Results 1 to 3 of 3
  1. #1
    madagaluna is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2011
    Posts
    2

    quarterly, excludes weekends and holidays

    Hi,

    I am building a database for work on ACCESS 2007, although will convert it to ACCESS 2000 due to our archiac computer system.

    The database will calculate the next quarter (from today's date) for a date previously entered on a table ( [ss_WIRB_IRB_2_Approval]![Date2Approved] ).

    I have tried the following:

    Review Due:
    Year([ss_WIRB_IRB_2_Approval]![Date2Approved])*4+DatePart("q",[ss_WIRB_IRB_2_Approval]![Date2Approved])=Year(Date())*4+DatePart(
    "q",Date())+1

    which returns "0", which I find very perplexing. Does anyone see my flaw?

    To complicate matters, I want to push the Review DUe to the next Monday if it happens to fall on a weekend and to the next workday if it happens to fall on a weekend. I have found a script that could be incorporated for weekends, although I am not sure where to put it and I don't know what the ?? would be:



    iif(datepart (“w”, date) <= ?? , date +1, date)


    I'm primarily using the wizard, although I know a little SQL.

    Any help would be greatly appreciated.

    Thanks!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    do the formulas in the attachment help?

  3. #3
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You cannot have an = sign in the middle of an expression:

    Year([ss_WIRB_IRB_2_Approval]![Date2Approved])*4+DatePart("q",[ss_WIRB_IRB_2_Approval]![Date2Approved])=Year(Date())*4+DatePart(
    "q",Date())+1

    If we were to evaluate the above equation using a date of 1/3/2011 for date2approved and today's date; this is what you would get:

    Year(1/3/2011)*4+1=Year(4/1/2011)*4+2+1
    or
    8044+1=8044+2+1
    or
    8045=8047


    I am confused as to what your trying to do & where you are trying to do it (in a form, query or report)?:

    The database will calculate the next quarter (from today's date) for a date previously entered on a table ( [ss_WIRB_IRB_2_Approval]![Date2Approved] ).
    If you want to get the quarter number for the the next quarter relative to today's date that can be done as follows:

    datepart("q", dateadd("q",1,date()))

    I'm just not sure what you want to do next...

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

Similar Threads

  1. Replies: 0
    Last Post: 04-01-2011, 09:12 AM
  2. How to analyze holidays/weekends
    By Galio83 in forum Queries
    Replies: 0
    Last Post: 03-31-2011, 12:27 PM
  3. Holidays falling between dates
    By Alex Motilal in forum Queries
    Replies: 1
    Last Post: 11-15-2010, 11:59 PM
  4. Quarterly Amounts
    By Brian62 in forum Queries
    Replies: 9
    Last Post: 10-16-2009, 02:18 PM
  5. calculate holidays
    By barkarlo in forum Queries
    Replies: 0
    Last Post: 12-20-2006, 06:08 AM

Tags for this Thread

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