Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Rcord Select Formula to Filter Post Reply Post New Topic
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Topic: Rcord Select Formula to Filter
     Posted: 03 Dec 2012 at 3:59am
I'm putting this data under Record Select and it's not returning info for me. When I take out the bottom 4 lines the report runs fine. Is there a different way that I need to write the bottom 4 lines?

{@XXXCompanyFilter} AND
{EPayHist.checkDate} >= CDATE ({@YYYPlanStartDate}) AND
{EPayHist.checkDate} <= CDATE ({@YYYPlanEndDate})
{EInfo.empType} = {@YYYempType1} AND
{EInfo.empType} = {@YYYempType2} AND
{EInfo.empType} = {@YYYempType3} AND
{EInfo.empType} = {@YYYempType4} AND
{EInfo.empType} = {@YYYempType5}

thank you in advance for all of your help!

Brian
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 03 Dec 2012 at 4:02am
{@XXXCompanyFilter} AND
{EPayHist.checkDate} >= CDATE ({@YYYPlanStartDate}) AND
{EPayHist.checkDate} <= CDATE ({@YYYPlanEndDate}) AND
{EInfo.empType} = {@YYYempType1} AND
{EInfo.empType} = {@YYYempType2} AND
{EInfo.empType} = {@YYYempType3} AND
{EInfo.empType} = {@YYYempType4} AND
{EInfo.empType} = {@YYYempType5}
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 03 Dec 2012 at 4:10am
Thanks Matt, I actually had that "AND" in there but took it out when i blanked out the bottom lines to get the report to work. When I do this:

{@XXXCompanyFilter} AND
{EPayHist.checkDate} >= CDATE ({@YYYPlanStartDate}) AND
{EPayHist.checkDate} <= CDATE ({@YYYPlanEndDate}) AND
{EInfo.empType} = {@YYYempType1}
//{EInfo.empType} = {@YYYempType2} AND
//{EInfo.empType} = {@YYYempType3} AND
//{EInfo.empType} = {@YYYempType4} AND
//{EInfo.empType} = {@YYYempType5}

I can put in a value for @YYYempType1 and the report will work but if i try to do more than 1 it returns a blank report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Dec 2012 at 4:10am
comatt1 is corrected in the fact that you are missing something where the AND was added but I think you have another issue in that the last 4 lines are all set to use AND. I find it unlikely that the same field is going to = all of your @YYYempTypeX formula. Since I do not know your data I am guessing you might need to rethink that part as well.
You ikeley need an OR set with parenth around that.

Edited by DBlank - 03 Dec 2012 at 4:11am
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 03 Dec 2012 at 4:14am
({@XXXCompanyFilter} AND
{EPayHist.checkDate} >= CDATE ({@YYYPlanStartDate}) AND
{EPayHist.checkDate} <= CDATE ({@YYYPlanEndDate})) AND
({EInfo.empType} in [{@YYYempType1},{@YYYempType2},{@YYYempType3},{@YYYempType4}{@YYYempType5}])      


Edited by comatt1 - 03 Dec 2012 at 4:15am
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 03 Dec 2012 at 4:16am
the @YYY fields are pass through data from Millenium (payroll program). Basically the report will be used by clients and they will enter additional data into the Millenium to pass through to the report in the @YYY fields to filter employee types ie. part time, full time, sub, holiday.

I will give the OR a shot but the client may need/want to know this info based on pt and ft employees which is why I was trying to offer 5 additional options for employee types.

Thank you for your help.
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 03 Dec 2012 at 4:18am
My solution will probably work, have you tried?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 03 Dec 2012 at 4:23am
THANK YOU comatt!
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 03 Dec 2012 at 4:27am
if I hadn't gone through this a million times I wouldnt have known either...

I am sure Dblank or Hilfy were the inital sources of my info anyways :)
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