Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks for a great forum. My problem was answered just by scrolling through previously solved problems. Great service!!..."

Geography

Where in the world do Tek-Tips members come from?
GMORA (IS/IT--Management)
19 Apr 12 12:24
Hi everyone, been working on this to long and need some help.

CR 11/sql2005

Current Output
Amount 1        Amount 2
1.00            2.00
                0.00

Desired Output as follows:
Amount 1        Amount 2
1.00            2.00
-               0.00

Desire is to show a hyphen where blank data is returned.

the sql table will hold zero's if, at runtime, there is suppose to be data but nothing has been entered. The table will also show blanks where data is not to be entered.  I can convert the blanks to zero with the report options but that is not what I need. Isnull does not detect these blanks as Null.

Blank = DASH
Zero = Zero

Thanks,
Gary



 
lbass (TechnicalUser)
19 Apr 12 13:17
If amount is a number field, then I think a "blank" can only appear for a null.

What do you see if you add a formula like instead of amount1?

if isnull(amount1) then
"Blank" else
amount1

-LB
 
GMORA (IS/IT--Management)
19 Apr 12 13:26
Yes, you are correct, that will create the dash. now the problem is on the ELSE portion it says a string is required here so I did totext({amount1}) and it seems to work. Do you see any problems with that solution?

if isnull({amount1}) then
"-" else totext({amount1})
Helpful Member!  lbass (TechnicalUser)
19 Apr 12 18:28
Sorry, yes, you'd have to use totext(). The problem is that you won't be able to use the results for calculation then. Another option would be to use the formula in the display string formatting area, but leave the values as numbers on the report. If you want to control the number of decimals, you can use:

totext(amount1,0,"") //0 for no decimals; "" for no comma, etc.

-LB

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close