Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How do I limit report data Post Reply Post New Topic
Author Message
ghusong
Newbie
Newbie


Joined: 11 Mar 2011
Online Status: Offline
Posts: 3
Quote ghusong Replybullet Topic: How do I limit report data
     Posted: 11 Mar 2011 at 10:06am
I am attempting to construct a report that will show me Item IDS received but want to limit it to everything except this last year. If it was received this year I don't want it to list the item_id on the report.

if "p21_view_po_line"."qty_received" >=1 and "Between" (received_date)
and Current date and time then
I have no Idea what I am doing...can someone please help me..


Edited by ghusong - 11 Mar 2011 at 10:07am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 14 Mar 2011 at 3:10am
I'm assuming you are connecting to a database?

Your condition can be summarized by the following question:

"Did I receive the item this year?"

You can use a record select formula which would essentially filter out anything that was received this year and therefore only display the ones that were not received this year.

The selection formula would be


{table.received date} <> Year(Today)


where I'm assuming your received date is a column in your DB.
IP IP Logged
ghusong
Newbie
Newbie


Joined: 11 Mar 2011
Online Status: Offline
Posts: 3
Quote ghusong Replybullet Posted: 14 Mar 2011 at 4:47am
Yes I am connected to a database.

True Received_date is a column in my report and yes if it was received Year to date I don't want the Item_id to show up on the report.
In the Sql Expression field I used.
"p21_view_po_line"."received_date" <> Year(Today)
I tried to save it and got the error.
There is an error in this sql expression. Would you like to save it anyway...


Edited by ghusong - 14 Mar 2011 at 4:48am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 14 Mar 2011 at 7:08am
I've never used SQL expression fields before.

I think it's easier if you just use a Command to query the DB and have the DB return what you want. That way, you don't have to do anything with the report itself.

So go to report expert --> Add Command --> type in the SQL query --> OK.

Then you can just drag your fields onto the report and it should be what you want..
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