#1
|
|||
|
|||
![]()
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?
__________________
iPrint Fusion Pro VDP Creator 9.3.22 Acrobat 11.0.10 and DC Mac OS 10.10 |
#2
|
||||
|
||||
![]()
You're comparing strings rather than dates. You should convert them to actual dates:
Code:
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');
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|