Click here to Skip to main content
16,004,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a project and part of this project is in Crystal Reports
It is not required to use VB/VB.Net code just Crystal Reports and Sql commands (retrieving data from the database)
And I have 2 Tables:
PurchaseOrder
- PurcaseOrderID
PurcaseOrderLines
-PurchaseOrderID
-PurcaseOrderLineID
-PartID
-RevisionID
I want to give the user the option to enter the data for OrderID and then to link this parameter with PartID (retrieve the data from the table-database)
Something like :
SQL
SELECT PartID
FROM PurchaseOrdersLines
WHERE EXISTS
  (select PartID,PartRevisionID
    from PurchaseOrderLines
    where PurhcaseOrderLines.PurchaseOrderID = PurchaseOrders.PurchaseOrderID
    And  PurcaseOrderLines. PurchaseOrderID= {?OrderID}


Or

 Select PartID
From PurchaseOrdersLines INNER JOIN PurchaseOrders ON PurchaseOrders.[PurchaseOrderID] = PurchaseOrdersLines.[PurchaseOrderID]
 Where PurchaseOrders.[PurchaseOrderID]={?@OrderID}

Thank you in advance.
Posted
Updated 3-Jun-10 22:39pm
v2
Comments
Sandeep Mewara 4-Jun-10 4:49am    
Okay. You explained what you 'want'. Now tell us, what have you tried? Where are you stuck up? Update your question with the details.

1 solution

In Crystal Reports you can select the tables used in that specific report and link them.

In this case use the PurchaseOrderID. (based on your query). Then create your parameter with a type corresponding to PurchaseOrderID.

In the menu of Crystal Reports you can 'modify' the where clause for the report and set the clause like this PurchaseOrders.[PurchaseOrderID]={?@OrderID}

If this is all new to you I suggest reading up on the topic (best is to buy a good book).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900