I changed the query to a table so I could make sure the dates were formatted
correctly. Now the calculation does work but now my calculation is not
correct.
Here are my 3 scenieros:
EarningsBEGINdate Bonus Eligible Date EarningsENDdate
7/1/2008 8/25/2008 9/30/2008
7/1/2008 11/24/2008 9/30/2008
7/1/2008 9/30/2008
How do I write the calc to give me the following:
If(Bonus Eligible Date > EarningsBEGINdate and Bonus Eligilbe Date <
EarningsENDdate, EarningsENDdate-Bonus Eligible Date
and also If(Bonus Eligible Date > EarningsENDdate return 0
Also If(Bonus Eligible Date blank then EarningsENDdate-EarningsBEGINdate.
Thank you SO Much for your assistance.
KARL DEWEY said:
I have my dates formatted as dates.
It is not a matter of formatting but whether the field in the table is
defined as a DateTime datatype.
I am calculating this from another query; will that cause the error?
It can if that query is returning text instead of DateTime data.
--
KARL DEWEY
Build a little - Test a little
:
Hi, Karl
Sorry, I am receiving #Error in my NumDays result field. I have my dates
formatted as dates. Can't figure out why I am not receiving the result.
I am calculating this from another query; will that cause the error? should
I convert the query to a table?
Thanks for your assitance.
:
You did not say what the error was.
You can try this --
NumDays: IIf([Bonus Eligible Date] > [EarningsBEGINdate], DateDiff("d",
[EarningsENDdate], [Bonus Eligible Date]), DateDiff("d", [EarningsENDdate],
[EarningsBEGINdate]))
--
KARL DEWEY
Build a little - Test a little
:
NumDays: IIf([Bonus Eligible
Date]>[EarningsBEGINdate],[EarningsENDdate]-[Bonus Eligible
Date],[EarningsENDdate]-[EarningsBEGINdate])
The above gives me #ERROR as result. How can I get it to return the number
of days.
Thanks