I have a table with two date fields
Both date fields are in a different subform, but in the same table and row
I want to compare dose fielfds.
Date 2 must be newer than Date 1
The pattern is D-M-YY
This is what i have so far, but is doesn't work
var vDate1 = Date2Num($.rawValue, "YY-M-D")
var vDate2 = Date2Num(DateField2.rawValue, "YY-M-D")
if (HasValue (vDate2)) then
if (vDate2 <= vDate1) then
xfa.host.messageBox("Error message")
$.rawValue = null
endif
endif
Is there someone who can help me with this?
Views
Replies
Total Likes
First print out one of the datefields in order to see the correct format.
For example:
xfa.host.messgeBox(DateField2.rawValue)
Then change the format to the correct one.
Date2Num(DateField2.rawValue, "YOUR-FORMAT")
You have to use the formattedValue for the date variables.
var vDate1 = Date2Num($.formattedValue, "YY-M-D")
var vDate2 = Date2Num(DateField2.formattedValue, "YY-M-D")
if (HasValue (vDate2)) then
if (vDate2 <= vDate1) then
xfa.host.messageBox("Error message")
$ = null
endif
endif
Thank you both.
It works
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies