Hi,
I assume you placed this macro in the Where clause of your webpart?
The macro seems ok.
The problem is you need to add single quotes to the result date. But the macro itself excludes the single quotes by adding an other quote.
So by making sure the query value is a date you can use the following macro:
{% result = "";
queryStartdate = FormatDateTime(QueryString.startDate, "yyyy-MM-dd");
if (queryStartdate!= null)
{ result = "StartDate > '" + queryStartdate+ "'";}
return result;|(handlesqlinjection)false|(identity)GlobalAdministrator%}
Might want to optimize it a bit, but this will get you going.
I didn't use your else statement since if left blank everything will be selected by default. If you need it you can just add it.
EDIT:
extra tip, did you know you can debug your macro's (and SQL and much more). If you go to Settings > System > Debug you can enable these settings:
This will give you extra info if your macro and query actually work!
Greets,
David