Calculate Date field

C

Connie

I am attempting to create a field in a form that would
calculate the first day of the next month based on a field
called [HireDate]. I need to create a field that would
look at the [HireDate] and calculate 1 year from that
date, and then add the correct number of days to show the
first day of the next month. (i.e. [HireDate] = 4/12/02
[VacStart]= 5/1/03) This would be the first of the month
AFTER one year anniversary of HireDate. Any suggestions?
Thanks.
 
R

Rick Brandt

Connie said:
I am attempting to create a field in a form that would
calculate the first day of the next month based on a field
called [HireDate]. I need to create a field that would
look at the [HireDate] and calculate 1 year from that
date, and then add the correct number of days to show the
first day of the next month. (i.e. [HireDate] = 4/12/02
[VacStart]= 5/1/03) This would be the first of the month
AFTER one year anniversary of HireDate. Any suggestions?
Thanks.

=DateSerial(Year([HireDate])+1, Month([HireDate])+1, 0)
 
C

Connie

-----Original Message-----
Connie said:
I am attempting to create a field in a form that would
calculate the first day of the next month based on a field
called [HireDate]. I need to create a field that would
look at the [HireDate] and calculate 1 year from that
date, and then add the correct number of days to show the
first day of the next month. (i.e. [HireDate] = 4/12/02
[VacStart]= 5/1/03) This would be the first of the month
AFTER one year anniversary of HireDate. Any suggestions?
Thanks.

=DateSerial(Year([HireDate])+1, Month([HireDate])+1, 0)

Rick,
I just tried this calculation and it works great EXCEPT
it gives me the last day of the month of the [HireDate].
(i.e. [HireDate] = 4/12/02, your calculation gives me the
date 4/30/03) What I need is 5/1/03..... So close, but
I'm not sure what to adjust. Thanks for your help!!
Connie
 
C

Connie

-----Original Message-----
Rick Brandt said:
I am attempting to create a field in a form that would
calculate the first day of the next month based on a field
called [HireDate]. I need to create a field that would
look at the [HireDate] and calculate 1 year from that
date, and then add the correct number of days to show the
first day of the next month. (i.e. [HireDate] = 4/12/02
[VacStart]= 5/1/03) This would be the first of the month
AFTER one year anniversary of HireDate. Any suggestions?
Thanks.

=DateSerial(Year([HireDate])+1, Month([HireDate])+1, 0)

Should have been...

=DateSerial(Year([HireDate])+1, Month([HireDate])+1, 1)


.TERRIFIC!! It worked great!! Thanks Rick! You're Tops!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top