IF Formula

D

debbiep

I have 5 different Classrooms. Kool Kidz is the only what that has a
criteria. All classes, I need one year added to [Date], Kool Kidz
criteria is If [Date] is >=9/2/07 then expiration is 9/1/08, if [Date]
is<9/2/07 then add one year to [Date]. I know it must be close, but it
still is not working, Can anyone give me some suggestions. Thank you
in Advance.

=IIF(and([ClassroomID]="Kool Kidz",[Date]>=9/2/07),
DateSerial(Year([Date])-(CLng(Format([Date],"mmdd"))>901),
9,1),DateAdd("yyyy",1,[Date])
 
D

debbiep

I have 5 different Classrooms. Kool Kidz is the only what that has a
criteria. All classes, I need one year added to [Date], Kool Kidz
criteria is If [Date] is >=9/2/07 then expiration is 9/1/08, if [Date]
is<9/2/07 then add one year to [Date]. I know it must be close, but it
still is not working, Can anyone give me some suggestions. Thank you
in Advance.

=IIF(and([ClassroomID]="Kool Kidz",[Date]>=9/2/07),
DateSerial(Year([Date])-(CLng(Format([Date],"mmdd"))>901),
9,1),DateAdd("yyyy",1,[Date])

YEAH, I got it. That was a tough one. Thank you for all your
suggestions.
 
R

ruralguy via AccessMonster.com

You need to surround a string date with the octothorp "#" and if your field
is really named [Date} you need to change that name because it is an Access
reserved word.

[YourDateField] >= #9/2/07#


I have 5 different Classrooms. Kool Kidz is the only what that has a
criteria. All classes, I need one year added to [Date], Kool Kidz
criteria is If [Date] is >=9/2/07 then expiration is 9/1/08, if [Date]
is<9/2/07 then add one year to [Date]. I know it must be close, but it
still is not working, Can anyone give me some suggestions. Thank you
in Advance.

=IIF(and([ClassroomID]="Kool Kidz",[Date]>=9/2/07),
DateSerial(Year([Date])-(CLng(Format([Date],"mmdd"))>901),
9,1),DateAdd("yyyy",1,[Date])
 

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