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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cast default value to null

Status
Not open for further replies.
Sep 12, 2005
448
US
hi All
Cr 9.0
ms sql
I've been ask if possible to assign a default value to a null
i check the box in my report option to default value to null.
my boss ask me if it's possible that i could assign a value to it
ex;
i have a channel and there are null in it
i have a parameter call {?Channel}
he asking is the user select channel: PC
to get the field that are pc and
to cast this value to the null
i think it's not possible but i said i will ask experts here


Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Flipping that switch will always convert to the default value (0 or "" depending on data type) but you could not check the box and write the following formula:

if IsNull ( {field} )
then "PC"
else {field}

Then use the formula in your criteria instead of the field itself.

Or you could do the cast n a view/command and use that as your data source.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top