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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiple date range

I need to select two different date range in the same selection, it's possibile?

es. 01/01/2009 - 31/01/2009 and 01/02/2010 - 28/02/2009

I try to use this macro

sub FiltroDate
set vA=ActiveDocument.Variables("FromDateDoc")
set vb=ActiveDocument.Variables("ToDateDoc")
set vC=ActiveDocument.Variables("FromDateDoc2")
set vD=ActiveDocument.Variables("ToDateDoc2")

Set repFld = ActiveDocument.GetField("DateDoc")

repFld.Select "(>=" + FormatDateTime(vA.GetContent.String) + " <=" + FormatDateTime(vB.GetContent.String) + ") or ( >=" + FormatDateTime(vC.GetContent.String) + " <=" + FormatDateTime(vD.GetContent.String) + ")"

but does not work

Thanks

2 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

TIP: In this expressions you can use the same expressions you use in the listboxe's search. Use them to test your expressions, then use it in your macro.

Not applicable
Author

I used a listbox object but when I use the search is ....... Datedoc xxxxx of yyyyyy