Solved

MS SQL Reporting format error

Posted on 2009-03-31
4
527 Views
Last Modified: 2012-06-27
Here is the format:

=format(cdec(Fields!SSN.Value), "###-##-####")

Error if the value is " ".  How to check before convert this field value to decimal?
0
Comment
Question by:monica73174
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:reb73
ID: 24031264
You should be able to use the ISNUMERIC function to check if the value is a number -

= IIF(IsNumeric(Fields!SSN.Value), format(cdec(Fields!SSN.Value), "###-##-####"), Fields!SSN.Value)
0
 

Author Comment

by:monica73174
ID: 24031427
still has error:
Here is the code:

=IIF(IsNumeric(Fields!SPOUSE_SSN.Value),format(cdec(Fields!SPOUSE_SSN.Value), "###-##-####"), Fields!SPOUSE_SSN.Value)

Error show in the field:  #Error

Warning message:
[rsRuntimeErrorInExpression] The Value expression for the textbox SPOUSE_SSN contains an error: Conversion from string "" to type 'Decimal' is not valid.
Preview complete -- 0 errors, 1 warnings



0
 
LVL 25

Accepted Solution

by:
reb73 earned 500 total points
ID: 24031945
Try using VAL() instead of CDEC()
0
 

Author Comment

by:monica73174
ID: 24032093
It works.  Thank you very much for your help!!!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now