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

record selection formula

Status
Not open for further replies.

klaidlaw

Programmer
May 28, 2008
140
0
0
US
I am writing a record selection formula with cr10 and I keep getting this error message: This function can't be used because it has to be evaluated later. how do I get around this error?
The formula:
{TransactionHeader.TransactionType} = "SHP" AND
{TransactionHeader.TransactionDate} = {?DateRange} and
({TransactionHeader.Reference} = previous({TransactionHeader.Reference}) )
and
{TransactionDetail.LineNumber} = previous ({TransactionDetail.LineNumber})


The problem is the previous...So if anyone has any ideas I would love to hear them thanks soo much!!
 
Dear Klaidlaw,

The previous function cannot be evaluated until after data is read. It is not intended to be used in Record Selection Criteria.

Can you explain in more detail exactly what you need the selection criteria to do and a little summary of the data you are delaing with?

Regards,
ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Rosemary,

I have a gross margin report and I sell different parts during the month. Each part number has a summary part of qty sold, sales, direct materials, direct labor, total cost, gross margin, and gross margin percent. The problem is that some of the parts are diplaying multiple times. So i will look like this:

part # sales qty DL DM TC GM GM%
A1540 16 2 5 5 10 6 37.5%

(details)
(line#) 1 8 1 2.5 2.5 5
2 8 1 2.5 2.5 5
1 8 1 2.5 2.5 5
2 8 1 2.5 2.5 5
1 8 1 2.5 2.5 5
2 8 1 2.5 2.5 5

The reason I know that the info is duplicated is because the line numbers are the same. I tried checkins select distinct records, I have been having this problem for a while so if you can help I would really appreciate it thanks for the time. By the way it is CR10 and Windows XP
 
Dear Klaidlaw,

Are you reporting off just one table or view? If not, how have you joined. Also, does the table or view you are reporting on have a primary key that uniquely identifies each record? If so, place that field on the report, do you get duplicates of that number?

regards,
ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Rosemary,

Thank you for your response, and I am linking many tables together. The Line number shows me when the data is repeating but the line number isn't in every table to how do I link it. The Line number it really only in one table. If it doesn't sound like I am understanding you please let me know I am very very new at this. Thanks for your time.

klaidlaw
 
Dear Klaidlaw,

What I was trying to first determine is whether your report was on just one view or table. You have answered that, as you state you are joining many.

The reason that I asked about a primary key in the table was that would show whether they were unique records that had the same data (line number duplicated in the database) or if the primary key was repeating as a result of how you have written your report.

Which leads me to how the tables are joined. Think of it this way: I have a table and it is related to another table with many records in that table related to my "main" table. This is called a one to many relationship. Now, if I join to that table and place fields from the main table in the detail section, it will appear to me to "repeat", but in fact it is correct that it is repeating as my main table is related to the child table for each record.

So, if you are indeed joining on many tables, do you actually need to? If you do, then record selection isn't your answer, formulas are.

Regards,
ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Rosemary,

Thank you for your response, I have to use all the tables I am linking to get the information I want. I have 7 tables total. Thank you for your explaining it soo clearly. I did make one formula that seems to supress the information that is duplicated, but the supressed information is showing up in the total formualas and thats what I want to stop I only want to total the information that is displayed. I have tried the running totals and couldn't get them to work either. So If you have any ideas it would really help. Thanks for all your time!

Klaidlaw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top