Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: comparing full date to month and date in 2 tables Post Reply Post New Topic
Author Message
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Topic: comparing full date to month and date in 2 tables
     Posted: 21 Dec 2009 at 8:37am
I have two tables with date fields. One table had a full date field. The other field has a month and year field. I need to pull some data from the second table but I am having problems with the formula. Here is what I have so far:

NumberVar ProductsGoal;


If  {GoalsWithProductSummary.goalmonth} = Month{DriveMaster.FromDateTime} and {GoalsWithProcedureSummary.goalyear} =
Year{DriveMaster.FromDateTime}
Then
ProductsGoal := {GoalsWithProductSummary.ProductGoal} ;

When I check the formula I am getting the error messaage "They keyword
then is missing"

Any help is always greatly appreciated.

Flanman
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 21 Dec 2009 at 10:53am
Try it like this:
 
If  {GoalsWithProductSummary.goalmonth} = Month({DriveMaster.FromDateTime}) and {GoalsWithProcedureSummary.goalyear} =
Year({DriveMaster.FromDateTime})
Then
ProductsGoal={GoalsWithProductSummary.ProductGoal} ;
 
ProductsGoal;
IP IP Logged
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Posted: 21 Dec 2009 at 11:05am
Thanks for the help. I was missing the () brackets on my month and year functions. Duhh.
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