Thanks Peter, actually the correct syntax you're thinking of is:
{% (QueryString.fromdate != "" && QueryString.todate != "")? "EventDate >= '" + SQLEscape(QueryString.fromdate) + "' and EventDate <= '" + SQLEscape(QueryString.todate) + "'" : "" |(identity)GlobalAdministrator%}
The problem with this logic is that it requires both "fromdate" and "todate" to be present, but I would like my macro to work with either of the parameters or both (I know to achieve this I'll need to add the and
conditionally too). My macro already works with "fromdate" only, but ignores "todate" section. So, can you point to the part of my macro that is incorrect?
The logic I'm looking for is something like this:
1. if "fromdate" is provided, concatenate the "fromdate" section.
2. If both "fromdate" and "todate" are presented, concatenate ' and '
3. If "todate" is present, concatenate the todate section.
Thanks again.