Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: IF help Post Reply Post New Topic
Author Message
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Topic: IF help
     Posted: 29 Nov 2012 at 5:58am
(IF "DGA" in {OPPOR.STE_1} then {OPPOR.ENDDAT_1}) +
(IF "DGA" in {OPPOR.STE_2} then {OPPOR.ENDDAT_2}) +
(IF "DGA" in {OPPOR.STE_3} then {OPPOR.ENDDAT_3}) +
(if "DGA" in {OPPOR.STE_4} then {OPPOR.ENDDAT_4}) +
(IF "DGA" in {OPPOR.STE_5} then {OPPOR.ENDDAT_5}) +
(IF "DGA" in {OPPOR.STE_6} then {OPPOR.ENDDAT_6}) +
(IF "DGA" in {OPPOR.STE_7} then {OPPOR.ENDDAT_7}) +
(IF "DGA" in {OPPOR.STE_8} then {OPPOR.ENDDAT_8}) +
(IF "DGA" in {OPPOR.STE_9} then {OPPOR.ENDDAT_9}) +
(IF "DGA" in {OPPOR.STE_10} then {OPPOR.ENDDAT_10}) +
(IF "DGA" in {OPPOR.STE_11} then {OPPOR.ENDDAT_11}) +
(IF "DGA" in {OPPOR.STE_12} then {OPPOR.ENDDAT_12}) +
(IF "DGA" in {OPPOR.STE_13} then {OPPOR.ENDDAT_13}) +
(IF "DGA" in {OPPOR.STE_14} then {OPPOR.ENDDAT_14})
 
I am trying to accomplish placing the date of the completion of a project in to the report. "DGA" is the code that signifies the project is complete. If the code in OPPOR.STE_0 is "DGA" then I want the corresponding DATE to appear in the report. Right now, it sends me an error that "A number is expected here" and it highlights the first row.
 
Any suggestions?
Thanks-
Minco
Be kind to those less fortunate.
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 29 Nov 2012 at 6:01am
Actually, it's the 2nd row that is highlighted as an error expecting a number... sorry
Be kind to those less fortunate.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 29 Nov 2012 at 9:40am
I am not sure if the 'in' operator is the correct operator to use for your comparison (would think you could use the "="), also it appears you are trying to add date values, is that what you wanted to do?  Will only one site have the DGA code per row or can multiple sites have the code?
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 29 Nov 2012 at 9:50am
I tried "=" before the "in" and neither work. I only want to see the date field in which a project is coded "DGA" in any of the 14 steps. There is a chance a project can be finished in step 5 or step 8 or any other step. What I need is the date in which a project is finished. I thought looking in each step field for DGA and then asking for the date field would do it, but I may be going about it the wrong way.
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2012 at 10:06am
your formula is trying to add dates to dates and it is expecting a numbere. I think you want something like
 
IF "DGA" in {OPPOR.STE_1} then {OPPOR.ENDDAT_1} else
IF "DGA" in {OPPOR.STE_2} then {OPPOR.ENDDAT_2} else
IF "DGA" in {OPPOR.STE_3} then {OPPOR.ENDDAT_3} else
if "DGA" in {OPPOR.STE_4} then {OPPOR.ENDDAT_4} else
IF "DGA" in {OPPOR.STE_5} then {OPPOR.ENDDAT_5} else
IF "DGA" in {OPPOR.STE_6} then {OPPOR.ENDDAT_6} else
IF "DGA" in {OPPOR.STE_7} then {OPPOR.ENDDAT_7} else
IF "DGA" in {OPPOR.STE_8} then {OPPOR.ENDDAT_8} else
IF "DGA" in {OPPOR.STE_9} then {OPPOR.ENDDAT_9} else
IF "DGA" in {OPPOR.STE_10} then {OPPOR.ENDDAT_10} else
IF "DGA" in {OPPOR.STE_11} then {OPPOR.ENDDAT_11} else
IF "DGA" in {OPPOR.STE_12} then {OPPOR.ENDDAT_12} else
IF "DGA" in {OPPOR.STE_13} then {OPPOR.ENDDAT_13} else
IF "DGA" in {OPPOR.STE_14} then {OPPOR.ENDDAT_14}


Edited by DBlank - 29 Nov 2012 at 10:06am
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 29 Nov 2012 at 10:15am
That worked perfectly DBlank! Thanks much!
 
Minco-
Be kind to those less fortunate.
IP IP Logged
Printable version Printable version

Forum Jump
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