Convert Date Range to Work Week Hours

I have a report which generates values based on a date range [StartDate] & 
[EndDate].  I am not sure that access can do this but what I need to be able 
to do is have Access generate the number of days or hours are available 
excluding weekends based on the date range.  For example:

StartDate = 1/1/2008
EndDate = 1/17/2008
Total Days = 17
Business Days = 13 (4 weekend days during this range)

Any help on calculating this is greatly appreciated.  Thanks
0
Utf
1/29/2008 8:43:00 PM
access.reports 4434 articles. 0 followers. Follow

1 Replies
1310 Views

Similar Articles

[PageSpeed] 6

Dwayne,
    Create a loop, starting with your StartDate, and adding 1 day on each 
iteration. (StartDate +1, +2, etc..)
    During each iteration, determine if the Weekday(TempDate) = 7 (Sunday) 
or 1 (Monday).
    If it is, DON'T increment a counter variable... if it isn't, DO 
increment a counter variable, and loop again until EndDate is reached.

    Note: You'll probably want to exclude holidays from the count also. 
Create a Holiday table with every holiday your company takes.
    ex.     HDay   Holiday
               7/4         4th of July
             12/25       Christmas
    Include a DLookup of the TempDate in the loop above, that checks to see 
if that day is in the Holiday table.  If exist = no count, if not = count 
that day.

    Check out Google Access Groups.  There should be many "calculate 
workdays" realated posts in there.
    Can't seem to find my code I wrote to do that.... I'll post it on this 
thread when/if I locate it.
-- 
    hth
    Al Campagna
    Microsoft Access MVP
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love... and you'll never work a day in your life."

..
"dwaynesworld" <dwaynesworld@discussions.microsoft.com> wrote in message 
news:17C6467F-46E6-45F7-9D32-7C5F9869B410@microsoft.com...
>I have a report which generates values based on a date range [StartDate] &
> [EndDate].  I am not sure that access can do this but what I need to be 
> able
> to do is have Access generate the number of days or hours are available
> excluding weekends based on the date range.  For example:
>
> StartDate = 1/1/2008
> EndDate = 1/17/2008
> Total Days = 17
> Business Days = 13 (4 weekend days during this range)
>
> Any help on calculating this is greatly appreciated.  Thanks 


0
Al
1/30/2008 1:10:15 AM
Reply:

Similar Artilces:

Week Number
Can I use the weeknum function to start on April 1st (ie 1st april = week 1) and not the default Jan 1 ? MTIA Elwyn I've never used this function but I think this would work, perhaps someone else would comment, =WEEKNUM(E1-90) Regards, Alan. "elwyn" <elwyn.meredith@btinternet.com> wrote in message news:IY2dnTDiIIjC30zUnZ2dnUVZ8h-dnZ2d@bt.com... > Can I use the weeknum function to start on April 1st (ie 1st april = week > 1) and not the default Jan 1 ? > > MTIA > > Elwyn ...

Convert text to time value
I have a series of time values in a 'General' format. They are of the type: 184525 Which is 18:45:25 or 6:45:25 pm. A time which is am would be of the type: 12345 Which is 1:23:45 am. Is there a way to convert those 'General' values to an Excel serial so that I can figure out the difference between two times? I've seen a bunch of examples on the net, but none of those that I have found deal with this format that I can tell. Thanks. Hi try =--TEXT(A1,"00:00:00") -- Regards Frank Kabel Frankfurt, Germany "Andy" <amelton@gmail.com> schrieb...

how to convert date
Hi, I'm looking for some method to convert mail date, in format: eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. I tried CTime but without resoults. m. Have you tried COleDateTime::ParseDateTime()? m.wski21.usunto@aust.com wrote: > Hi, > > I'm looking for some method to convert mail date, in format: > eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. > I tried CTime but without resoults. > > m. >I'm looking for some method to convert mail date, in format: >eg. "Sun, 18 Sep 2005 20:57:08 +0200&qu...

Odd date problem
I'm reposting this as this is a very strange problem in Access. I'm using 2003. After my entry is an entry by missinglinq via AccessMonster.com who was able to reproduce the error. Looking forward to comments/fixes. Thanks, Rob I have the following in the DblClick event for the control CaseStart which is a date/time field. The problem is that once the control is double clicked the form remains in edit mode, even though I've told it not be editable. Additionally, when the control is double clicked, it shoudn't enter in the time until the Edit button has been clicked o...

How to Convert UTC to localTIme(C# )
I have got the value of user account's lastlogon time. Its type is Int64. This value is stored as a large integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC)(Refer to MSDN). I don't know how to convert this value to localTime. The following is my code. ################################################################ DirectoryEntry deUser = new DirectoryEntry(ldappath); DirectorySearcher src = new DirectorySearcher(deUser); src.Filter = "(&(objectClass=user)(SAMAccountName=" + accountNa...

How do I convert dates to text keeping the format?
I'm trying to convert a column of data in date format *m/d/yyyy to a text format without converting to serial numbers. Ie: I want to retain the mm/dd/yyyy format. Is there a way to do this? =TEXT(A1,"MM/DD"/YYYY") "sprlarry" <sprlarry@discussions.microsoft.com> wrote in message news:69669AA6-FD15-47D7-843D-FC768728BF7A@microsoft.com... > I'm trying to convert a column of data in date format *m/d/yyyy to a text > format without converting to serial numbers. Ie: I want to retain the > mm/dd/yyyy format. Is there a way to do this? That ...

SUM a range based on month
I need to SUM a range of cells only if it is in a certain month. =SUMIF(sheet1!A4:A10000,">="&DATE(2004,2,1),values) This formula sums all months from Feb 1 on. I only want February. Is there a way to enter the end date in my formula? I need to do this for every month. Joe =SUMPRODUCT(--(TEXT(Sheet1!A4:A10000,"mmm")="Feb")) HTH Jason Atlanta, GA >-----Original Message----- >I need to SUM a range of cells only if it is in a certain month. > >=SUMIF(sheet1!A4:A10000,">="&DATE(2004,2,1),values) > >This formula su...

Delete some column headings from an autofiltered range.
I've selected a range of cells e.g. A6 to CP83 and autofiltered this range. I wish to retain the list headings for columns A to C but wish to remove the list headings from the remaining columns D to CP without affecting the overall list range. Can this be done? "Champ" wrote: > I've selected a range of cells e.g. A6 to CP83 and autofiltered this range. I > wish to retain the list headings for columns A to C but wish to remove the > list headings from the remaining columns D to CP without affecting the > overall list range. Can this be done? .....

Excel: Auto converting text to numbers
I am downloading an Excel sheet, and the numbers come in as text. It basically comes in as "33 %" but Excel registers this as text, not a percentage. I have a cell that will be used to add the numbers, but since they are text it doesn't work. Given this information, is there a way to convert the imported data into numbers. I would prefer to include this into my formula. The potential numbers are: 0, 1, 2, 3, 4, 0 %, 25 %, 33 %, 50 %, 67 %, 75 %, 100 %, and N/A I would prefer a function, again if possible, that could convert any number. Please note, the space between the nu...

how to convert excel's .cvf file to .csv file
...

Convert Access97 to 2000
Hello, we're currently running access97 and would like to convert it to 2000, but we don't know what is the administrator password for this database. Also this database is running on multi user and have difference permission for diffence users. Could someone help me how to do make this happen but keep the currently permission retaint. Thanks ...

Dos not work correct "Search" function
Hello, I use MS Excel 2002 (10.6809.6804) SP3 and have some troubles: when I use Search function (Ctrl + F) in WorkSheet, Excel could not find same data. Randomly it may find same or not /with same conditions of search on same data/. I make example (Screenshot please look here: http://img205.imageshack.us/my.php?image=555jv4.jpg ) in my WorkSheet - I ask Excel to look position with No 68361310 (you may see it below in sheet) and it could not find it. Why? Thank you for yours reply’s If 68361310 is the result of a formula, you should not use Look in Formulas, but Look in Values ...

Dates not correct
How do I get my DateDif output to reflect the correct 30 days in a month. Im getting 49 days, it should be pulled to the months and 19 days in days. 2 years, 11 months, 49 days See this for examples: http://cpearson.com/excel/datedif.htm Biff <belczyk@gmail.com> wrote in message news:1177357276.085439.98020@e65g2000hsc.googlegroups.com... > How do I get my DateDif output to reflect the correct 30 days in a > month. Im getting 49 days, it should be pulled to the months and 19 > days in days. > > > 2 years, 11 months, 49 days > ...

Convert 2000 Calendar to web page
Greetings, When I convert my calendar for 2005 to a webpage, the page is off by 1 day. Is there a template or fix available to fix this? Thanks, Duane I can edit the html file but this should not be the case. Fixes? Suggestions...other than use Apple? "Duane Perry" <dlp_sr@yahoo.com> wrote in message news:yZRtd.5561$0r.1710@newsread1.news.pas.earthlink.net... > Greetings, > > When I convert my calendar for 2005 to a webpage, the page is off by 1 day. > Is there a template or fix available to fix this? > > Thanks, > > Duane > > Duane, ...

Outbox displays Received Date
Need some help on this one. I'm using Outlook 2000 on a Windows XP machine and for some odd reason the Outbox now displays the "Received" date and the Inbox displays the "Sent" date. How do i correct this. It seems to be hidden in the PST file because when I login on a different machine it shows the same thing. Right click on the column headers and choose the "Field Chooser". Drag the field you want to see from the Field Chooser into the column headers area. Drag column headers you don't want to see away from the column headers. "Lee" ...

Font color automatic does not work in Excel
In MS Word 2003, Font Color Automatic changes to white when selecting a dark Fill Color. In MS Excel 2003, Font Color Automatic always appears to be black independently from Fill Color. Am I doing something wrong? You're not doing anything wrong. Excel doesn't change the automatic font colour if the cell is filled with a dark colour. Eric Jan van de Veen wrote: > In MS Word 2003, Font Color Automatic changes to white when selecting a dark > Fill Color. In MS Excel 2003, Font Color Automatic always appears to be black > independently from Fill Color. Am I doing something...

Invoice Due Date #2
Hello, I'm using Money Small Business 2006 and need some help. How can I specify the due date on a invoice? It seems to automatically use the date that the invoice is created on. All help appreciated. Thank you. > How can I specify the due date on a invoice? It seems to automatically > use the date that the invoice is created on. Below the Line Item table there is a link "To add or edit billing and shipping addresses, notes, or other information, go to the Invoice Details". Click that link and you can specify the Payment Terms. I don't see where to specify a cet...

Redefining ranges
I use the following code that will not allow an end user to close a spreadsheet until all specified cells are entered. Private Sub WorkBook_BeforeClose(Cancel As Boolean) If Application.WorkSheetFunction.CountA(Sheets("Sheet1") _ .Range( "Customer" ) <8 Then MsgBox " You must fill in all cells" Cancel = True End If End Sub Now it works okay with one sheet but we have hundreds of sheets with more added daily. How can I restructure the code to redefine the ranges for each sheet ( the sheets being identical ) and that as each new sheet is...

x axis to show days but graph to plot in hours
(using excel 2007) Sorry if this has been answered, I have tried to find similar with no luck. I have several days of data, measured hourly. I want to plot a line graph so that the y axis shows concentration (easy enough) but the x axis shows days while plotting in hours. I have tried a number of options but I always end up with either with several lines (instead of 1 line running throughout that I am after) or have 120 hours worth of points running along the bottom, it looks cluttered and often unreadable (this however doesn't really matter). I would like to try and s...

XML Note convert to DataSet
Hello, I have this function: object acmResponse = acmLogin.acmString("4001", "", paramFormLogin + paramUserBasics);System.Xml.XmlNode[] acmNodes = (System.Xml.XmlNode[])acmResponse; What I have todo, to convert the XML Object in the DataSet Object? Thank you Matthias ...

Convert
Is it possible to convert a Money file created in the USA version to that of the UK version? Thanks in advance The general way is QIF Export then Import. It's involved and has limitations like loan accounts don't QIF. See http://www.bollar.org/msmoney/#Q1. "Crispy" <nowayspammers@hotmail.com> wrote in message news:uQKSfzfyDHA.2500@TK2MSFTNGP09.phx.gbl... > Is it possible to convert a Money file created in the USA version to that of > the UK version? ...

Problem converting from Quicken to M2005
My Quicken files are mostly investment related, and generally converted fine. However all bonds (regular and muni's) converted as Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) How do you change the Investment Type for an item? Thank you. In microsoft.public.money, Mike wrote: >My Quicken files are mostly investment related, and generally >converted fine. However all bonds (regular and muni's) converted as >Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) Money typically converts custom data types from Quicken into funds. I thou...

Number of hrs worked in a week, based on dates in a different column
Hi. I'm hoping someone will give this a try. I'd like to enter a function into each cell in column D so that the total hours worked for the previous week appears each Sunday. For instance, cell D6 would display 11, the sum of C2:C6 (note this is a short week). Cell D20 would display 22.5, the sum of C7:C20. On some days, no work at all is performed, but on other days multiple tasks are performed. The only cells in column D that should display a value are the Sunday's... all other cells should display nothing. Thanks very much for your help!! Gregg. ...

OWA not working
I am awefully new to win2k3 and exchange 2003. I have configured everythng correctly(I hope) but when I try to access mailboxes remotely I get an error message. The OWA URL: http://server.domainname.com/exchange/username Error Message: You are not authorized to view this page The Web server you are attempting to reach has a list of IP addresses that are not allowed to access the Web site, and the IP address of your browsing computer is on this list. -------------------------------------------------------------------------------- Please try the following: Contact the Web site administr...

Numbers converting to decimal
I a trying to figure out why when I type 11 and automatically converts it to .11, if I type 11. it will stay 11,if I change all the cells to text then back to number they willstay. I have checked the formatting of the cells, it even happens when I open a brand new worksheet. Any ideas? Thanks Dawn Hi Dawn, Tools>Option>Edit, uncheck Fixed Decimal -- Kind Regards, Niek Otten Microsoft MVP - Excel "DawnP" <anonymous@discussions.microsoft.com> wrote in message news:c3cf01c48a05$d75359d0$a501280a@phx.gbl... > I a trying to figure out why when I type 11 and &...