Click to See Complete Forum and Search --> : What is Crystal Report's operator for 'where'?
acaalb
May 13th, 2009, 05:10 PM
I would like a sub report to pullup a vendor's matching ID to a material called for in the main report. I've gotten this far..
{Vendor_material.Material_Owner}={?PM-MC_RFQ_TTX.sMaterial} and
{RFQ_Vendor.Send_To_Address}={?PM-MC_RFQ_TTX.Send_TO_Address}
(the send_to_address fields are available in both the original report and one of the tables in the subreport)
I get double IDs. If I use only the top sentence, I get all ID's. I'd like to use 'where' instead of 'and' but Crystal doesn't like it.
Can someone direct me? I am really new at this.
thanks
cajsoft
May 14th, 2009, 03:57 AM
[code]
if {Vendor_material.Material_Owner}={?PM-MC_RFQ_TTX.sMaterial} then
if {RFQ_Vendor.Send_To_Address}={?PM-MC_RFQ_TTX.Send_TO_Address} then
...
...
[code]
acaalb
May 14th, 2009, 07:50 AM
Thanks very much for responding.
here's what I have in the Formula Editor for the subreport
If I explain my thinking will you tell me where I went wrong? This statement retrieves nothing.
If the material reference in one of the two tables for the subreport equals the material reference in the main report... (btw this gets me all associated material references)
and then if the address in one of the two tables equals the address in the main report (this should narrow it down to the one being printed)
then
make the material reference fill up the 'uniqueNumber' parameter (which I can place on the subreport)
Does that make sense to you? Vendor_Material and RFQ_Vendor are the two tables I pulled in.
If{Vendor_Material.Material_Owner} = {?Pm-MC_RFQ_TTX.sMaterial}then
if {RFQ_Vendor.Send_To_Address} = {?Pm-MC_RFQ_TTX.Send_To_Address}then
{Vendor_Material.Vendor_Reference} = {?uniqueNumber}
thanks
cajsoft
May 14th, 2009, 08:13 AM
If I'm following you right, then you want to return records based on the key from the main report.
if so, then user the 2 keys from the main report in the subreport selection criteria or use a stored procedure to pull the releavant data on to the subreport using the 2 keys from the main report and link them.
is that what you mean?
acaalb
May 14th, 2009, 01:29 PM
I'm really new so apologies and gratefulness. I will explain better
While printing an RFQ, I would like to add the Vendor reference # associated with Material. Some material have 5 or 6 different vendors. Vendor references sit in Vendor_Material
I did this
{Vendor_Material.Material_Owner} = {?Pm-MC_RFQ_TTX.sMaterial} and
this ties the subreport into the main report. They are the same value - I checked
{RFQ_Vendor.Send_To_Address} = {?Pm-MC_RFQ_TTX.Send_To_Address}
this ties the subreport into the main report and acts as a filter ..also same value
It now pulls up the correct Vendor Reference number but in multiples.
Is there a way of doing this that comes back with only one?
brucevde
May 14th, 2009, 02:13 PM
I too am having a hard time figuring out exactly what you are trying to achieve.
It now pulls up the correct Vendor Reference number but in multiples. Are you saying the exact same Vendor Reference is printing multiple times?
Is there a way of doing this that comes back with only one? You mentioned a material can have 5 or 6 different vendors. Is the problem that the subreport should only be printing 1 vendor reference but it is returning 2 or more different ones.
Maybe posting some screen shots would clarify the problem.
acaalb
May 14th, 2009, 03:46 PM
re: a Crystal reports subreport for an RFQ that contains the Vendor Reference associated with the ‘Material’ number.
1. I called up and linked in 2 tables that contain vendor and vendor material information. I know these are linked correctly. My thought is that I need them both since I need Vendor_Material.Material_Owner and RFQ_Vendor.Send_To_Address as filters
2. What I want to do is populate the subreport field with the vendor reference number associated with the ‘Material’ referred to in the RFQ
3. When I use this formula in the formula editor I get the correct vendor reference number in the subreport.
{Vendor_Material.Material_Owner} = {?Pm-MC_RFQ_TTX.sMaterial} and
{RFQ_Vendor.Send_To_Address} = {?Pm-MC_RFQ_TTX.Send_To_Address}
However I get as many instances of it as there are references associated with ‘Material’. I want only one instance. How can I filter out the other instances?
acaalb
May 20th, 2009, 01:53 PM
I Found it
It wasn't the code - it was the placement on the subreport. I bought The complete reference book :) and it talked about how placement changes output.
I tried it and voila
Thanks for taking the time to answer
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.