i have a crystal report that calls a view on my sql server. the query runs just fine.. but the table is getting a wee bit to big so its starting to hang my report. what i would like to be able to do is pass in a where statement into my select statement, example WHERE F.OrderNumber = '0050517' this way my crystal will not bomb out. can a view take in a value? or is there some other way of goign about this problem. all i can think of is creating a SPROC that my application fires and it would copy the needed data into a temp table. and have that view look off the temp table that the SPROC filled. or does someone else have another way they accomplish this task?
cheers.
cheers.
Code:
SELECT '708971' + B.ItemNumber AS UPC, B.ItemNumber, D.ItemDescription, SUM(CAST(B.Quantity AS int)) AS Qty, SUM(CAST(D.Weight AS float)) AS totalWT,
B.OrderNumber, D.Weight, SUM(CAST(B.Quantity AS int)) / E.PercentUnitLoadMult AS Unit, A.ShippedDate, A.ShipTo_Name, A.ShipTo_Address,
A.ShipTo_Address2, A.ShipTo_City, A.ShipTo_State, A.ShipTo_Zip, A.OrderNumber AS OrderNumber , A.CarrierName, C.LoadNumber, C.StopNumber,
A.PONumber, A.ShippedDate AS ShippedDate , F.PlannedShipDate, F.PromiseDate
FROM dbo.ConfirmationHeader A INNER JOIN
dbo.ConfirmationDetail B ON A.OrderNumber = B.OrderNumber INNER JOIN
TranWorking.dbo.tblOrderMasterfile C ON C.OrderNumber = B.OrderNumber INNER JOIN
QueryMaster.dbo.IM1_InventoryMasterfile D ON D.ItemNumber = B.ItemNumber INNER JOIN
TranMaster.dbo.tblInventoryMasterfile E ON E.ItemNumber = B.ItemNumber INNER JOIN
TranWorking.dbo.tblOrderMasterfile F ON F.OrderNumber = A.OrderNumber
GROUP BY B.OrderNumber, B.ItemNumber, A.ShippedDate, A.ShipTo_Name, A.ShipTo_Address, A.ShipTo_Address2, A.ShipTo_City, A.ShipTo_State,
A.ShipTo_Zip, A.OrderNumber, A.CarrierName, C.LoadNumber, C.StopNumber, D.ItemDescription, D.Weight, A.PONumber, F.PlannedShipDate,
F.PromiseDate, E.PercentUnitLoadMult