Date Comparison/@if statement

I’m attempting to do 2 checks - one to see if the field is blank and one to check that the invoice date is less than the date created:

date_check := @date(InvoiceDate) < @Date(DateCreated);

@If((CreditNote = “Yes”);@Do(

@If(InvoiceDate !=“”;@Success ; date_check ;@success;

@Failure (“Please enter a valid Invoice Date”)));@success);


the error msg says “time/date expected”

any ideas as to what I’m doing wrong?

Thanks

Subject: Date Comparison/@if statement

Seems like one of your ‘dates’ isn’t really a date/time field.Perhaps something like this will fix it?

date_check := @TextToTime(@Text(InvoiceDate)) < @TextToTime(@Text(DateCreated));

@If((CreditNote = “Yes”);@Do(

@If(InvoiceDate !=“”;@Success ; date_check ;@success;

@Failure (“Please enter a valid Invoice Date”)));@success);

Subject: RE: Date Comparison/@if statement

Thanks for your suggestion Ken - I’ve managed to sort it now :o)