Soldato
Hi, so I'm wanting to use a control condition(date) as the start point for a DATEADD
What is probably confusing the issue(me) is that I'm using MS Web developer as the tool to bring these components together. For instance I have a dropdownlist (sqldatasource1) which contains a date field which is the feeder for the second sqldatasource2 which runs a query where I wish to return rows from the last 7 days from sqldatasource1.
sqldatasource2 as follows:
SELECT DISTINCT
SUM(CASE WHEN No = 'No' THEN 1 ELSE 0 END) AS NoCount, SUM(CASE WHEN Yes= 'Yes' THEN 1 ELSE 0 END) AS YesCount,
Actual_Date
FROM vw_view
WHERE (Actual_Date = @Actual_Date)
GROUP BY Actual_Date
@Actual_Date references the control condition set in sqldatasource1. The above will return rows for that single date, where as I'm wanting to return rows for the previous 7 days from that date.
My logic is telling me I need to adjust the WHERE clause similar to "WHERE (Actual_Date >= DATEADD(day, -7, @Actual_Date())" but that's not working![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
Any help/guidance much appreciated.
Cheers, Paul.
What is probably confusing the issue(me) is that I'm using MS Web developer as the tool to bring these components together. For instance I have a dropdownlist (sqldatasource1) which contains a date field which is the feeder for the second sqldatasource2 which runs a query where I wish to return rows from the last 7 days from sqldatasource1.
sqldatasource2 as follows:
SELECT DISTINCT
SUM(CASE WHEN No = 'No' THEN 1 ELSE 0 END) AS NoCount, SUM(CASE WHEN Yes= 'Yes' THEN 1 ELSE 0 END) AS YesCount,
Actual_Date
FROM vw_view
WHERE (Actual_Date = @Actual_Date)
GROUP BY Actual_Date
@Actual_Date references the control condition set in sqldatasource1. The above will return rows for that single date, where as I'm wanting to return rows for the previous 7 days from that date.
My logic is telling me I need to adjust the WHERE clause similar to "WHERE (Actual_Date >= DATEADD(day, -7, @Actual_Date())" but that's not working
![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
Any help/guidance much appreciated.
Cheers, Paul.