Results 1 to 8 of 8

Thread: What is Crystal Report's operator for 'where'?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    5

    What is Crystal Report's operator for 'where'?

    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

  2. #2
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    Re: What is Crystal Report's operator for 'where'?

    [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]
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    5

    Re: What is Crystal Report's operator for 'where'?

    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

  4. #4
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    Re: What is Crystal Report's operator for 'where'?

    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?
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    5

    Re: What is Crystal Report's operator for 'where'?

    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?

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: What is Crystal Report's operator for 'where'?

    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    5

    Re: What is Crystal Report's operator for 'where'?

    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?
    Last edited by acaalb; May 19th, 2009 at 10:21 AM. Reason: clarity

  8. #8

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    5

    Re: What is Crystal Report's operator for 'where'?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width