Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Help with iif
Author
Message
nkdatana
Newbie
Joined: 23 May 2012
Online Status: Offline
Posts: 2
Topic: Help with iif
Posted: 23 May 2012 at 7:00am
I am having a problem with a formula containg an if statement. Can anyone help
IIF ({EQ_MAIN.DEPREC_MONTHS_LIFE} = 0, "NA", ToText ((DateAdd ("m", ({EQ_MAIN.DEPREC_MONTHS_LIFE}), ({EQ_MAIN.IN_SERVICE_DATE}),
"MM/dd/yyyy"
))))
I get an error that says "Too many arguments have been given to this function"
I don't know how to post a screen
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 23 May 2012 at 7:39am
IIF (
{EQ_MAIN.DEPREC_MONTHS_LIFE} = 0, "NA",
ToText
(DateAdd("m",{EQ_MAIN.DEPREC_MONTHS_LIFE},{EQ_MAIN.IN_SERVICE_DATE}), "MM/dd/yyyy" )
)
IP Logged
nkdatana
Newbie
Joined: 23 May 2012
Online Status: Offline
Posts: 2
Posted: 23 May 2012 at 12:16pm
Thanks. I had figured it out before I go thte response here. However I used CStr. Is there any benefit to using ToText instead
IIF ({EQ_MAIN.DEPREC_MONTHS_LIFE} = 0, "NA",
CStr ((DateAdd ("m", ({EQ_MAIN.DEPREC_MONTHS_LIFE}), ({EQ_MAIN.IN_SERVICE_DATE}))), "MM/dd/yyyy" ))
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 24 May 2012 at 3:59am
totext and cstr are the same so no added value either way
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.