Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: StringVar "Others" on first value Post Reply Post New Topic
Author Message
Simon106
Newbie
Newbie


Joined: 31 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Simon106 Replybullet Topic: StringVar "Others" on first value
     Posted: 13 May 2009 at 2:04am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 May 2009 at 6:53am
I don't see it, but what I would do is list all of the table fields on the same line as the formula, or create a new section and list them there, to see if there hole in your formula/what the cases look like that are causing the incorrect answer to be displayed.
IP IP Logged
Simon106
Newbie
Newbie


Joined: 31 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Simon106 Replybullet Posted: 13 May 2009 at 8:19am
local stringVar s:="" ;

if {DB.SO_ODD}=1 and {DB.SO_EVEN} = 0 then "Fortnightly ODD"

else if {DB.SO_ODD}=0 and {DB.SO_EVEN} = 1 then "Fortnightly Even"

else if {DB.SO_ODD}=1 and {DB.SO_EVEN} = 1 and {DB.SO_WK1}=1 and {DB.SO_WK2}=1 and
        {DB.SO_WK3}=1 and {DB.SO_WK4}=1 and {DB.SO_WK5}=1 then "Weekly"

else (
      if {DB.SO_WK1}=1 then s:= "W1 ";
      if {DB.SO_WK2}=1 then s:= s & "W2 ";
      if {DB.SO_WK3}=1 then s:= s & "W3 ";
      if {DB.SO_WK4}=1 then s:= s & "W4 ";
      if {DB.SO_WK5}=1 then s:= s & "W5 ";
        s
     )



SO_ODD  SO_EVEN  SO_WK1    SO_WK2    SO_WK3    SO_WK4    SO_WK5
1            1            0              1               1              1               1

should read WK2 WK3 WK4 W5 but doesn't it shows "Other"???



SO_ODD    SO_EVEN    SO_WK1    SO_WK2    SO_WK3    SO_WK4    SO_WK5
1               1              1              0              1              0               0

This works fine it shows W1 W3

Seems to happen when SO_WK1 is 0??

Thanks in Advance!!

Simon


Edited by Simon106 - 13 May 2009 at 8:20am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 May 2009 at 8:23am
Are there possibly nulls in this process that need to be accounted for in the formula?

Edited by DBlank - 13 May 2009 at 8:23am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 May 2009 at 9:11am
I think that the part that is confusing is that it says "Others", which isn't an option.
 
By chance is there another variable called s in the report?  Maybe it isn't local scope.  I would try changing the variable name maybe ss or sWeekly.  I would also try moving where s is displayed, that might give an idea of what's going on.
 
I would give that a try, if the results are the same, I am at a loss, as the formula looks spot on.
IP IP Logged
Simon106
Newbie
Newbie


Joined: 31 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Simon106 Replybullet Posted: 14 May 2009 at 1:11am
This doesn't seem to help......doh!!
IP IP Logged
Simon106
Newbie
Newbie


Joined: 31 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Simon106 Replybullet Posted: 14 May 2009 at 3:45am
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