If expression

  • Thread starter quinto via AccessMonster.com
  • Start date
Q

quinto via AccessMonster.com

If an employee has been employed less than one year "Yes" if not "No"
I tried this in a Text box in the report but it does not work ,can some help
me?
IIf([DOH]+365<[Date()],"Yes","No")


Thanks
 
A

Allen Browne

Remove the square brackets around the Date() function.

It might be better to use the DateAdd() function (copes better with leap
years):
=IIf(DateAdd("yyyy",1, [DOH]) < Date(), -1, 0)
Then format the text box as yes/no.

(That expression gives you a real true/false value that you can evaluate
further if needed, not merely the text yes or no.)
 
Q

quinto via AccessMonster.com

GREAT, I used your suggestion

Thanks

Quinto

Allen said:
Remove the square brackets around the Date() function.

It might be better to use the DateAdd() function (copes better with leap
years):
=IIf(DateAdd("yyyy",1, [DOH]) < Date(), -1, 0)
Then format the text box as yes/no.

(That expression gives you a real true/false value that you can evaluate
further if needed, not merely the text yes or no.)
If an employee has been employed less than one year "Yes" if not "No"
I tried this in a Text box in the report but it does not work ,can some
help
me?
IIf([DOH]+365<[Date()],"Yes","No")
 

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