iprint2 Posted August 9, 2018 Posted August 9, 2018 Below is the rule that I am working with if (FormatDate(Field("BIRTH_DATE"),"mm/dd/yyyy") > FormatDate("08/31/1963","mm/dd/yyyy")) { return Resource("Entertainment TL_Sept.jpg"); } else { return Resource("Better with Age Day_new TL_Sept.jpg"); } My problem is that I have the date of 10/08/1942 and it is returning the Entertainment graphic rather than the Better with Age Day and I have a 05/15/1976 that is doing the opposite. Other dates are working fine. Any idea what I am doing wrong? Quote
step Posted August 10, 2018 Posted August 10, 2018 You're comparing strings rather than dates. You should convert them to actual dates: var birthday = new Date(Field('BIRTH_DATE')); var cutoff = new Date('08/31/1963'); var file = birthday > cutoff ? 'Entertainment' : 'Better with Age Day_new'; return Resource(file + ' TL_Sept.jpg'); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.