Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula on formula in Report Post Reply Post New Topic
Author Message
gnaus
Newbie
Newbie
Avatar

Joined: 13 Sep 2011
Location: Netherlands
Online Status: Offline
Posts: 14
Quote gnaus Replybullet Topic: Formula on formula in Report
     Posted: 13 Sep 2011 at 11:13pm

Dear reader,

 

I’ve made a report and everthing is functioning properly.

But…  when I add an other formula on that report, he triggers on a formula he accepted before!

At first he says the formula is oke, but when I refresh, I get the message: “Tekenreeks met onjuiste datumnotatie” (in English something like: String with wrong dateformat).

 

So he triggers on something he didn’t trigger on before.

I think CR has een problem with “formula on formula”.

 

The formula I use:

 

            @Examendatum

cdate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum})

(examendatum is a string)

 

 

@VerlopenBekwaamheid

(

If {ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Herhalingsinterval}="24"  then

dateadd("yyyy",2,cdate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum}))

else

if {ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Herhalingsinterval}="12"  then

dateadd("yyyy",1,cdate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum}))

else

if {ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Herhalingsinterval}="6"  then

dateadd("M",6,cdate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum}))

)

 

 

@Verlopen

if{@VerlopenBekwaamheid}<Currentdate then "J"

 

 

So far so good

Alle these formula work properly together in the report

 

But when I use the next formula: (in the select expert), he triggers and I get the fault I mentioned above.

 

(I use a parameter -?Verlopen of niet verlopen of beiden?- with string with the options “Verlopen” and “Niet verlopen”)

 

 

(

if {?Verlopen of niet verlopen of beiden?}="Verlopen" then ({@Verlopen})="J"

else

if {?Verlopen of niet verlopen of beiden?}="Niet verlopen" then ({@Verlopen})<>"J"

)

 

 

So when I place this latest formula I get the message: “String with wrong dateformat”

And he points to the formule above: @VerlopenBekwaamheid at: cdate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum}

 

 

 

I also tried to use this (in formula @VerlopenBekwaamheid) :

 

If IsDate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum}) Then

 CDate({ABR_ACTIEVE_MEDEWERKERS_MET_CURSUSSEN.Examendatum})

 

But this doesn’t help and I don’t know where to place this , in wich formula on wich place and how (with “and” or “else”?)

 

I hope someone knows how to make this work

Thank you very much!

 

GN
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 14 Sep 2011 at 3:10am
The first thing I would try is to make formulae to show each of the cdates  you have in @VerlopenBekwaamheid , and @Examendatum, individually, and put them on the page separately. This might show where you have a date that is in a format it doesn't like.
IP IP Logged
gnaus
Newbie
Newbie
Avatar

Joined: 13 Sep 2011
Location: Netherlands
Online Status: Offline
Posts: 14
Quote gnaus Replybullet Posted: 14 Sep 2011 at 5:56am
Thank you for your reaction! I let you know, when I found the wrong date!
GN
IP IP Logged
gnaus
Newbie
Newbie
Avatar

Joined: 13 Sep 2011
Location: Netherlands
Online Status: Offline
Posts: 14
Quote gnaus Replybullet Posted: 14 Sep 2011 at 9:58pm

Super! thanks a lot!!!         I found it. :)

The bottelneck was indeed an emtpy field ("examendatum" of course) in one specific record

(not even "NULL" but really empty and that triggered the formula).

 

Fortunately mij formulae weren't wrong ;-).

 

Greetings,

 

GN
IP IP Logged
gnaus
Newbie
Newbie
Avatar

Joined: 13 Sep 2011
Location: Netherlands
Online Status: Offline
Posts: 14
Quote gnaus Replybullet Posted: 15 Sep 2011 at 1:28am
by the way, the showing of the date  he doesn't like is not totally possible because CR "jumps" out of the report on the page where the bottleneck is, but that brought me further of course/anyway.
GN
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 15 Sep 2011 at 2:20am
Glad I could help. And if you temporarily remove the formula it jumps out of, you should be able to see all the dates
IP IP Logged
gnaus
Newbie
Newbie
Avatar

Joined: 13 Sep 2011
Location: Netherlands
Online Status: Offline
Posts: 14
Quote gnaus Replybullet Posted: 15 Sep 2011 at 2:33am
aha! that's true! sharp! :) thanks!
GN
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