Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying get script which will execute if it is Monday of the week or else it will exit and if its 2nd day of the month it will execute or else it will exit. I will schedule this script in nprinting every day. As I know in nprinting I can only schedule it for only one type either weekly or monthly. If I schedule it for every day, reads the scripts and execute accordingly. Hope this make sense. Just need script to put it at the top the query I have.
May be this
IF WeekDay(Today()) = 'Mon' or Day(Today()) = 2 then
TableName:
LOAD ....
FROM ...;
......
ENDIF;
Anything between IF and ENDIF will only run if it is Monday or 2nd day of the month....
May be this?
IF ( WeekDay(Today()) = 'Mon' OR
Today() = Date(Num(Monthstart(Today())+1)) , 'ExecuteScript' , 'Exist Script')
Hi, Vishwa,
, 'ExecuteScript' , 'Exit Script') this bit is coming with red undrlined??
May be this
IF WeekDay(Today()) = 'Mon' or Day(Today()) = 2 then
TableName:
LOAD ....
FROM ...;
......
ENDIF;
Anything between IF and ENDIF will only run if it is Monday or 2nd day of the month....
Is that all Nprinting does for you? Are you using it as a scheduler to run your script?
Using the if statement in a load script will make the QVW empty on the days it shouldn't run.
But it won't stop the rest of your Nprinting process (like export) unless you put a condition on your report.
Follow Sunny's Script. Its simple and comprehensible.
I was little lazy sorry about that. Its Monday morning thing. 🙂
I actually meant like
IF ( WeekDay(Today()) = 'Mon' OR
Today() = Date(Num(Monthstart(Today())+1)) Then
Your execution load script
ELSE
Exit Script
END IF;