GetElapsedDays()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a query using the GetElapsedDays to get business days
that an employee is out of the office. When I use the GetElapsedDays() on
its own it works fine but when I try to drill down futher by having the query
/7*5 it Errors out and when I try to use and expression with /7*5 it gives me
fractions and not whole numbers. Can anyone help me on this?

Thanks, Donna
 
I am trying to create a query using the GetElapsedDays to get business days
that an employee is out of the office. When I use the GetElapsedDays() on
its own it works fine but when I try to drill down futher by having the query
/7*5 it Errors out and when I try to use and expression with /7*5 it gives me
fractions and not whole numbers. Can anyone help me on this?

Thanks, Donna

Well, dividing an integer by 7 will give fractions (unless of course it's a
multiple of 7). What actual expression are you using?

Consider using the \ integer-divide operator: 6\7 = 0, 8\7 = 1; or the Fix()
function to truncate the expression to the next lower integer.

John W. Vinson [MVP]
 
I am using:
Expr1: GetElapsedDays([Date]-[StartDate])
Expr2: [Expr1]/7*[Days_work_per_week]

Any help would be appreciated.
Donna
 
I am using:
Expr1: GetElapsedDays([Date]-[StartDate])
Expr2: [Expr1]/7*[Days_work_per_week]

Any help would be appreciated.

Did you try my suggestion? To reiterate:

Consider using the \ integer-divide operator: 6\7 = 0, 8\7 = 1; or the Fix()
function to truncate the expression to the next lower integer.


John W. Vinson [MVP]
 
Yes I did, as I understand it, but it gave me so totally off the wall number.
Perhaps I just need to add some code to the GetElapsedDays() module that
excludes weekends?

Donna

John W. Vinson said:
I am using:
Expr1: GetElapsedDays([Date]-[StartDate])
Expr2: [Expr1]/7*[Days_work_per_week]

Any help would be appreciated.

Did you try my suggestion? To reiterate:

Consider using the \ integer-divide operator: 6\7 = 0, 8\7 = 1; or the Fix()
function to truncate the expression to the next lower integer.


John W. Vinson [MVP]
 
Yes I did, as I understand it, but it gave me so totally off the wall number.
Perhaps I just need to add some code to the GetElapsedDays() module that
excludes weekends?

Well, since I don't know what you were getting nor what you wanted, I just
answered the question as asked instead of the question you wanted answered...
<g>

Check out http://www.mvps.org/access/datetime/date0012.htm for some code that
handles weekends (and also holidays, which simple arithmatic operations
won't).

John W. Vinson [MVP]
 
Back
Top