Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have 2 listboxes with timestamps, HH:MM. Open and Close.
I want to check the current time to see if the store is open and or closed. So i want to return a 0 or 1.
This is my expression: if(time(now(1))>Open AND time(now(1))<Close, 1, 0)
But it does not work.
It shows 0 when the open is 11:00 and close is 23:00 and now the time(now) = 10:47
Thanks!!
You cann't use Time as it is
if(time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close, 1, 0)
Becuase Time function internally it keeps the date value too.
If this didn't works, could you please tell how your storing the time range in Open and Close?
Hi
The expression looks OK, but it will only work in a chart/table expression or you have made selections so that no more than 1 possible open and close value (for each row in a chart).
HTH
Jonathan
Can you let me know, In which format you are having Open and Close Time.
And also can you share some sample data.
--Jai
Are you considering A.M/P.M in now()?
You cann't use Time as it is
if(time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close, 1, 0)
Becuase Time function internally it keeps the date value too.
If this didn't works, could you please tell how your storing the time range in Open and Close?
That works! Thanks!
No since im living in Sweden we don't use AM/PM
HH:MM
One more question.
I have the 2 listboxes with PRU and AREA.
If i want a chart to show if(time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close, 0, 1) but only for PRU A and AREA A how can i hardcode this into my if statement?
Thanks!