Saturday, February 25, 2012
Checking values with range parameters
i want to check where order_date between {?Datapara}
where date parameter is a single field that has range.I have CR XI, can not swear this is supported in earlier releases.
Go to the sample reports and open the Record selection on date range.
look at the select statement and check out the report custom formulas.
You may be able to do this same thing in earlier versions, but I do not know that for certain. Only have CR XI
Friday, February 24, 2012
checking the error code
I am sending a list of comma separated codes as a parameter to stored
procedure. As I parse the list, I put them in the table variable (or temp
table) using insert statement.
For example if the parameter is 1001,3233,4444,2223,4452,5523, after the
parsing, the table variable will contain 6 rows with the respective code.
Now, do I need to check @.@.ERROR after each insert statement whether it was
successful or not even though I am dealing with table variable?
Of course I am trying to avoid following approach
WHILE EndOfListCondition
BEGIN
BEGIN
INSERT tblCode(Code) VALUES(@.ParsedCodeID)
SET @.ErrorCheck = @.@.ERROR
IF @.ErrorCheck <> 0 GOTO ERR_HANDLER
END
END
and use
WHILE EndOfListCondition
BEGIN
BEGIN
INSERT @.tableVariable(Code) VALUES(@.ParsedCodeID)
-- ? Do I need error check here?
END
END
INSERT tblCode(Code)
SELECT Code
FROM @.tableVariable
Thanks
JJustin (jyang@.ioutsource.info) writes:
> I am sending a list of comma separated codes as a parameter to stored
> procedure. As I parse the list, I put them in the table variable (or temp
> table) using insert statement.
> For example if the parameter is 1001,3233,4444,2223,4452,5523, after the
> parsing, the table variable will contain 6 rows with the respective code.
> Now, do I need to check @.@.ERROR after each insert statement whether it was
> successful or not even though I am dealing with table variable?
Now that is a good question. Fortunately, the answer in SQL 2005 is
simple: set up a TRY-CATCH handler that embraces the entire procedure
as a matter of routines.
In SQL 2000, it's worse. My own approach is that I always check
@.@.error after every INSERT, DELETE and UPDATE although that I know
that some of them just can go wrong. Then again, I'm not checking
error after SELECT, despite a lot of our client code is running with
SET LOCK_TIMEOUT 29000. (Which is a stpuid idea.)
What I do to make this easier, is that I have some clips in my editor
(Textpad), so that I can easily add error checking. I'm also formatting
it compactly, so that it does not take up too much space.
Error handling in SQL Server 2000 is a boring business. For more
advice, my article http://www.sommarskog.se/error-handling-II.html
could be of interest.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Sunday, February 19, 2012
Checking Format of a string in Report Parameter
Is there a way to find out if the user entered the date in correct format for the report parameter? For example, I am using string data type and requring the user to enter date in yyyy/mm/dd format. Can I capture and prompt the user accordingly if the date string is not provided in the above format?
Why dont you create the parameter in a Datetime format and let the user enter it in a date time format. After that you use the functions to convert itto a string in your desired format.
|||You might be able to take advantage of the isDate() function; however, at the moment I don't see how to apply it.
Thursday, February 16, 2012
Checking for NULL parameters in an expression
Sunday, February 12, 2012
Checkboxes in Reporting Services?
Is it possible to have a checkbox as a parameter.. So a user can check a box to include a column or uncheck to hide a column ?
Thanks
Neil
Hello Neil,
I don't believe there is a way to get a checkbox in the parameters section. Would True/False radio buttons work for you? If so, you can use the Boolean type for your parameter.
Hope this helps.
Jarret
|||Hi Jarret,Yes radio buttons could work... Although I have just made a parameter boolean but it still rendered as a drop down..
Is there anything specifically I need to do to make the parameter a radio button ?
Thanks.
Neil
|||
What version of Reporting Services are you using?
You should be able to set your parameter to Boolean without any available values and it should show radio buttons. Make sure you don't have Multi-value selected either.
Jarret
|||There we go!Thanks man!!! I was setting an available value.
Thanks so much!!
Neil.
|||
No problem, glad I could help.
Jarret