Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
EliGohar
Partner - Specialist
Partner - Specialist

IF condition to run between specific time range

Hi,

I want to write an IF condition that will check if the current hour (when the script is running) is between 4:50 AM - 4:59 AM and If the condition is true then perform a couple of actions.

I tried this:

LET vNow= timestamp(Now(),'DD/MM/YYYY h:mm:ss') ;
LET vStartTime = timestamp(Today(),'DD/MM/YYYY 04:50:00');
LET vEndTime = timestamp(Today(),'DD/MM/YYYY 04:59:00');

IF vNow >= vStartTime and vNow <= vEndTime THEN

But it's always False.

Many thanks,

Eli.

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Hi,

 

take this

LET vNow= timestamp(Now(),'DD/MM/YYYY hh:mm:ss') ;
LET vStartTime = timestamp(Today(),'DD/MM/YYYY 04:50:00');
LET vEndTime = timestamp(Today(),'DD/MM/YYYY 04:59:00');

IF vNow >= '$(vStartTime)' and vNow <= '$(vEndTime)' THEN

 

Regards

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

 

take this

LET vNow= timestamp(Now(),'DD/MM/YYYY hh:mm:ss') ;
LET vStartTime = timestamp(Today(),'DD/MM/YYYY 04:50:00');
LET vEndTime = timestamp(Today(),'DD/MM/YYYY 04:59:00');

IF vNow >= '$(vStartTime)' and vNow <= '$(vEndTime)' THEN

 

Regards

EliGohar
Partner - Specialist
Partner - Specialist
Author

@martinpohl I was close 🙂

Thanks mate!