Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null values to sp

Status
Not open for further replies.

simma

Programmer
Sep 11, 2001
398
US
Hello
How do I pass null values in parameters to sp through crytal reports.
I tried running in query analyser,query with null values works but when I pass empty values from crystal ist doesnt
Please advice
Thanks
 
Click the 'Set to Null Value' checkbox. Or put some logic in the procedure to see if an empty string was passed in, then set the parameter to NULL.

-dave
 
Thanks vidru!
where is 'Set to Null Value' checkbox?
 
In Crystal, when you run a report and the parameter window comes up, above and to the right of the 'Discrete Value' box, you should see a checkbox that says 'Set to NULL Value'.

-dave
 
I am running Crystal 7.0 .May be thats why I dont see it.
Thanks
 
Yeah, posting technical info about your environment is good.

Nulls are always a problem for Crystal, and using parms with SP's have less control.

Correct this in the SP to check for some defaults and treat them like null.

-k
 
Thanks for your feedback synapsevampire !!
 
Is this the procedure in this thread thread183-705409?

If you want to simulate passing NULL values to the procedure, you can do it like this:

CREATE PROC TestProc
@Param1 VARCHAR(20),
@Param2 VARCHAR(20)
AS
IF (@Param1 = '')
SET @Param1 = NULL

IF (@Param2 = '')
SET @Param2 = NULL

then go on about the rest of your business...

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top