Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i am trying to put an if statement in my script to say that if date(today()) is included in a list of dates then run the script otherwise exit script.
so i have a list of dates that i would first need to load in, i'm guessing as a variable, i then want to compare todays date with that variable. if a match is found then carry on with script, else exit.
I am unsure on how to do this, i cam do it in the front end but obviously thats no good, i cant seem to convert it to scripting.
can anyone help please?
Hello,
This is an example:
TableA:
Load
...,
DateField
From/Resident X;
let vRows=NoOfRows('TableA');
let vToday=date(Today(),'your format');
let vScriptExit='Exit script;';
for i=0 to $(vRows)-1
let vDateFromList= chr(39)&peek('DateField',i,'TableA')&chr(39);
if wildmatch(vToday, $(vDateFromList)) then
$(vScriptExit);
endif
next i;
Hope it helps,
Andrei
Hello,
This is an example:
TableA:
Load
...,
DateField
From/Resident X;
let vRows=NoOfRows('TableA');
let vToday=date(Today(),'your format');
let vScriptExit='Exit script;';
for i=0 to $(vRows)-1
let vDateFromList= chr(39)&peek('DateField',i,'TableA')&chr(39);
if wildmatch(vToday, $(vDateFromList)) then
$(vScriptExit);
endif
next i;
Hope it helps,
Andrei