Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

position to a specific record as a "starting" point?

Status
Not open for further replies.

itprsn

MIS
Jan 6, 2004
40
US
I'm running Windows XP, using Crystal Reports XI, accessing a ProvideX 6.2 database. I'm working with an invoice detail table that has over 500,000 records and trying to find a way to position to a specific record as a "starting" point so the whole table doesn't have to be read before it returns the final report. i.e. maybe the first invoice for 2006 is '225000' and I want to start there, not read all the records for the invoices prior to '225000', which takes forever. Is there any way to "point" to the first record with Crystal? Thanks, Kathy
 
Hi,
Assuming that the database you use is even slightly efficient and has an index on the needed field, then using a record selection formula of

{tablename.invoice#} > 22500

should be fairly fast .



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
It looks like the problem was caused by that logic being in the Record Selection Formula Editor instead of the in the Add Command section. Apparently the Add Command logic takes precedence (sp?) over the Record Selection Formula Editor??? Not sure how they work together but it seems to be working.

In addition to the Add Command logic I had entered ({Command.inv_cm_date} in {?Period_1_From_Date} to {?Period_1_To_Date} or
{Command.inv_cm_date} in {?Period_2_From_Date} to {?Period_2_To_Date})in the Record Selection Formula Editor because the same logic (different syntax) either errors out in Add Command or runs forever. Does this make sense to you?

Thanks, Kathy
 
It should work fine in the Add Command, and please don't sya errors out, state what the error is, we can't help if you just say it errors out.

So post what you tried in the Add Command, it should prove much faster than doing so in Crystal (should...), as if you place it in the record selection then crystal retrieves all rows and then starts throwing them out.

The add command should have something like:

....
where
(
Command.inv_cm_date >= {?Period_1_From_Date}
and
Command.inv_cm_date <= {?Period_1_From_Date}
)
or
(
Command.inv_cm_date >= {?Period_2_From_Date}
and
Command.inv_cm_date <= {?Period_2_From_Date}
)
and
<whatever other criteria you wish to use.>

-k


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top