Um, no sorry, looking at my results more closely that's clearly not
right. Doesn't handle the roll-over into the next year correctly. I'm
going off-line now, I'll try to look at it again tomorrow unless someone
else comes up with a solution before then.
--
Brendan Reynolds
Access MVP
If I understand the question correctly, I believe this should do it ...
SELECT tblTest.HireDate, DateSerial(Year([HireDate]),
IIf(Day([HireDate]) < 15, 1, 2), 1) AS BenefitDate
FROM tblTest;
Here are some sample results (dd/mm/yyyy format) ...
HireDate BenefitDate
14/12/2001 01/01/2001
14/01/2002 01/01/2002
15/12/2001 01/02/2001
15/01/2002 01/02/2002
16/12/2001 01/02/2001
16/01/2002 01/02/2002
--
Brendan Reynolds
Access MVP
I've gone over the information on Brendan's link, I guess my problem is
trying to figure out the right way to write the Iff statement to
distinguish
between people hire before the 15th and people hired after.
--
Lori A. Pong
:
Use the DateAdd and DateDiff functions. There are examples and links
to
further information at the following URL ...
http://office.microsoft.com/en-gb/assistance/HA010546621033.aspx#b60
--
Brendan Reynolds
Access MVP
Basically I need two things for a new database.
1. How do I get a query to automatically calculate a date six months
from
a
date in a separate field?
2. How do I calculate the number of months an employee has been
working
with
a company. (I have a field for the StartDate)?