Hello, I've created an Expression Web form with a SQL datasource which is doing a query/select statement.
Somehow it appears that I'm making a syntax error. When I divide the query in two and execute them separate, it works fine.
I need to filter for an EventType, Region and Today's date + a custom interval (like 7 day's for a week)
The parameters come from a search form where the user can select these values via a dropdown list.
The two separate (and working) queries within my form are:
Query nr.1 :
"Select * from Events WHERE (([EventType] LIKE '%' + @EventType + '%') AND ([Region] LIKE '%' + @Region + '%'))">
<asp:formparameter DefaultValue="%" FormField="EventType" />
<asp:formparameter DefaultValue="%" FormField="Region" />
Query nr.2 :
"SELECT * FROM Events
WHERE StartDate >= DATEDIFF(DAY, 0, CURRENT_TIMESTAMP) AND StartDate < DATEADD(DAY, @NrDays, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP));">
View Complete Post