Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Expression in Report Not Working Expand / Collapse
Author
Message
Posted Wednesday, May 15, 2013 3:08 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 12, 2014 4:46 AM
Points: 158, Visits: 504
Can any one advise me as to why this expression is not working please?

=IIf
(Fields!clockStart.Value > 0, (DateAdd("d",126,Fields!clockStart.Value)) ,"")

All it returns is #Error.

All i want to be able to do is apply the 126 days addition to the clockstart date but only to the rows where a clockstart value is present.

Thanks in advance for any sugestions
Post #1452983
Posted Wednesday, May 15, 2013 6:48 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:37 PM
Points: 10,206, Visits: 13,152
There's nothing that jumps out at me as incorrect with the syntax of the expression. The only thing I'd wonder about is what happens when Fields!clockStart.Value is NULL. I'd try something like this:

=IIf(ISNOTHING(Fields!clockStart.Value) = false OR Fields!clockStart.Value > 0, (DateAdd("d",126,Fields!clockStart.Value)) ,"")

The other thing I try when troubleshooting expressions is adding a textbox to the body of my report and test each part of my expression in that textbox to see which one is causing the error.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1453062
Posted Wednesday, May 15, 2013 7:39 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 12, 2014 4:46 AM
Points: 158, Visits: 504
Many Thanks
Post #1453096
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse