Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Problem selecting records between dates Post Reply Post New Topic
Author Message
aekelund
Newbie
Newbie


Joined: 05 Apr 2007
Online Status: Offline
Posts: 20
Quote aekelund Replybullet Topic: Problem selecting records between dates
    Posted: 09 Dec 2009 at 1:33pm
I'm trying to create a formula field that looks at a date field and if the dates are between two variable date fields which are the first day of the previous month and the last day of the previous month.  When I run the formula below I get nothing, when I know there are records in the date ranges specified.  Because I have ran a SOL query on the database and have received records back.

Formula script:
IF (({productionData.Date}) In (Date(11/1/2009) to Date(11/30/2009)))
THEN ({productionData.partsProducedLH} + {productionData.partsProducedRH})



Edited by aekelund - 09 Dec 2009 at 1:34pm
Andrew
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Dec 2009 at 1:51pm
Are you putting this in your select expert?
If so do not use the if-then. YOu only need to do the first part which can also be written as:
{productionData.Date} In LastFullMonth
IP IP Logged
aekelund
Newbie
Newbie


Joined: 05 Apr 2007
Online Status: Offline
Posts: 20
Quote aekelund Replybullet Posted: 10 Dec 2009 at 7:04am
No I am not putting this in the select expert, this is a formula field.  I'm trying to add two fields together if the date on the record is between the first day of previous month and the last day of the previous month. When I try to do this it I get Zero's for all the records when I know there are records in the database for this time period.
Andrew
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Dec 2009 at 9:47am
OK. I would try testing your parts out as I do not see any issue with your formula
Try to just return a text field on the first condition to make sure that works. Place it on your detail section to validate it
if {productionData.Date} In LastFullMonth then "Add" else "Ignore"
Did you get the right values for each row?
If you did then try the next part seperate
{productionData.partsProducedLH} + {productionData.partsProducedRH}
Did it giove you the right values for all rows?
 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.