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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table to Array

Status
Not open for further replies.

mmorala

MIS
Aug 18, 2003
14
US
Hi,
I have a small table that I want to make into an array so that Crystal can compare the records it pulls into the report against this array.

How can I convert a table into an array?
and
How do I iterate through the array to compare each value?

Thanks,
Michael
 
Firstly, what are you trying to do? I'm finding it really difficult to work out why you would want to do this.


Reebo
UK
 
Reebo makes sense here, rather than describing how you are addressing a requirement, why not state what the requirement is and see if someone has another approach.

Arrays probably aren't the best approach to comparing data.

-k
 
Sorry,

I have a report that pulls customer information. Each customer has a unique ID number.

Each year, we generate a list of customers to whom we send a promotional discount. This list changes yearly and is sent to 10-15 customers per year. Among other things, this report shows what we charge each customer, based on a formula in the report. If they are one of the customers that are being offered a discount, we calculate their price differently.

So instead of hard-coding who is getting the discount into the report and having to change the report yearly, we just store the new information in the database. Then, we can just compare the report to the table to see who was offered the discount.

So I thought the best way to do this was to pull the table into an array and compare each customer to this array to adjust the way their price gets calculated.

Thanks,
Michael
 
The best way to do this sort of common task is to do the comparison in the database, not in Crystal.

This "new information in the database" should just be joined to the existing tables.

Since I've no idea if this means a different table in a different database, I can't spell it out for you, but you have no need for an array.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top