Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: formula and variable concatenate Post Reply Post New Topic
Author Message
bharatp
Newbie
Newbie


Joined: 19 Dec 2012
Location: United States
Online Status: Offline
Posts: 3
Quote bharatp Replybullet Topic: formula and variable concatenate
     Posted: 19 Dec 2012 at 8:38am
Hey Guys, I am new in Crystal reports. try to do simple thing I am try to do warninig about how many days left.
 
StringVar out ;
NumberVar x;
x = ({vehicle.dathy} + 1825)  - Today; " Days Left ";
 
try to get result as 518 days left.
 
 
please help me.
 
 
bharat
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Dec 2012 at 9:58am
First off the "=" is a comparison operator, not an assignment operator.  The ":=" is the assignment operator.  Since we do not know the value (or datatype) of {vehicle.dathy}, we do not know what to expect.
IP IP Logged
bharatp
Newbie
Newbie


Joined: 19 Dec 2012
Location: United States
Online Status: Offline
Posts: 3
Quote bharatp Replybullet Posted: 20 Dec 2012 at 2:57am
ok Thanks,
 
StringVar out ;
NumberVar x;
x := ({inspectiondate} + 1825)  - Today + " Days Left ";
 
Here is what I am trying to do I have inspection date adding 1825 days and substract today so x number of days left for next inspection.
I have changed to := .
 
Still I get error as "A number, currency amount, or date is required here."
 
Please take a look.
 
Thanks in advance
Bharat
IP IP Logged
bharatp
Newbie
Newbie


Joined: 19 Dec 2012
Location: United States
Online Status: Offline
Posts: 3
Quote bharatp Replybullet Posted: 20 Dec 2012 at 4:02am
Guys I got it.
 
StringVar out ;
NumberVar x;
x := {vehicle.dathy} + 1825  - Today ;
if  (x < 0) then
 out := "  Expired "
else
out := Totext (x,0) + "  Days Left";
 
Thanks for help..
 
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