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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to compare current timestamp in macro

Dear All,

Please look into the piece of code 

set FD = ActiveDocument.Variables("From Date") '' variable for Initial date
FrmDtt=(FD.GetContent.String)

if ToDtt>now() then
msgbox "Order To Date can not be greater than Today, Please choose proper date"

set v = ActiveDocument.Variables("To Date")
v.SetContent Now(),true

if condition is always true and i tried to convert it number using num , but it say type mismatch in macro .

working fine in frontend

Regards

Pramod Kumar

1 Solution

Accepted Solutions
Not applicable
Author

used variable to compare

thanks

Pramod Kumar

View solution in original post

2 Replies
Not applicable
Author

used variable to compare

thanks

Pramod Kumar

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use the Evaluate API function with QV expressions.

If ActiveDocument.Evaluate("if $(FromDate)>now()") Then

-Rob