IF Then conditional format

awake2424

Registered User.
Local time
Yesterday, 23:10
Joined
Oct 31, 2007
Messages
479
I have a field on a form OrderDate and a field DOB. I am not sure how to create an expression in conditional formatting that:

=IF([DOB] - [OrderDate] <30), Then background is red

So if the OrderDate is 1/1/2014 and the DOB is 1/15/2014 then the DOB field turns red

If the OrderDate is 1/1/2014 and the DOB is 2/29/2012 then the DOB field does not turn red. Thank you.
 
Try a condition of:

([DOB] - [OrderDate]) < 30
 
I have:

Expression is ([OrderDate]-[DOB])< 30 in the conditional format

OrderDate 1/15/2014
DOB 1/14/2014

the DOB field does not turn red however. Thank you.
 
Are you using Expression Is? I just tested that expression in a db and it worked as expected. Can you post the db here?
 
I can not post the db, I am using Expression is. Thanks
 
Not sure what to tell you then. It worked for me as in the attached.
 

Attachments

  • Conditional.jpg
    Conditional.jpg
    46.9 KB · Views: 148
Are the date fields text instead of Date/Time?
 
you could also try
DateDiff("d",[ORDERDATE],[DOB])<30

That should help if your problem is text fields rather than dates
 
you could also try
DateDiff("d",[ORDERDATE],[DOB])<30

That should help if your problem is text fields rather than dates

If it is the case then the only sensible solution would be to fix the problem by changing the field type to date/time.
 

Users who are viewing this thread

Back
Top Bottom