asked on
To use parameters in a CR Command:So you will then insert those params where you have 8 and 2013 below
Create the parameters in the Command edit window. It has to be there, as opposed to the main CR editor window. Once the parameters are created, they can be edited from the main window.
Then, basically, insert the parameter name where you need it in the SQL code. The simplest thing is to position the cursor where you want the parameter and then double-click the parameter name in the parameter list on the right. When CR runs the query, it will simply replace the parameter name with its value. If the parameter value could be a string, put the parameter name in single quotes. For a date or datetime, I don't think you'll need them.
SELECT
[Assessee Name:]
, COUNT([Unique Ref]) AS 'Total'
, 'No of Assessments' AS 'Type'
FROM [Temp Database$A1:AB10000]
WHERE [Skill Category] = 'Total'
AND MONTH([Date & Time]) = 8 -- param here
AND YEAR([Date & Time]) = 2013 -- and another param here
GROUP BY [Assessee Name:]
SELECT
[Assessee Name:]
, COUNT([Unique Ref]) AS 'Total'
, 'No of Assessments' AS 'Type'
FROM [Temp Database$A1:AB10000]
WHERE [Skill Category] = 'Total'
AND MONTH([Date & Time]) = MONTH(getdate()) -- "auto month"
AND YEAR([Date & Time]) = YEAR(getdate()) -- "auto year"
GROUP BY [Assessee Name:]
SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.
TRUSTED BY
Please elaborate on what this means.