Skip to Content
0
Former Member
Jan 09, 2008 at 05:06 PM

Query Parameter Question

27 Views

I'm trying to add a parameter range to an existing query but I'm never prompted to enter a parameter, I just get 0 records returned- I'm sure I'm missing something 😊, here is the query-

SELECT TOP 100 PERCENT dbo.OITM.ItemCode AS Part, dbo.OITM.ItemName AS Description, dbo.OITM.OnHand, dbo.OITM.IsCommited AS Allocated,

dbo.OITM.U_toOrdPt AS OrdPt, dbo.OITM.OnHand - dbo.OITM.IsCommited AS Available, dbo.OITM.OnOrder,

CASE WHEN dbo._FSsalestots.YTD IS NULL OR

dbo._FSsalestots.YTD LIKE ' ' THEN dbo.[_YTD Sales].SAPYTD WHEN dbo.[_YTD Sales].SAPYTD IS NULL OR

dbo.[_YTD Sales].SAPYTD LIKE ' ' THEN dbo._FSsalestots.YTD ELSE dbo._FSsalestots.YTD + dbo.[_YTD Sales].SAPYTD END AS YTD,

dbo._FSsalestots.PYTD, CASE WHEN U_toPhased = 'Y' THEN 'PHASED' ELSE NULL END AS Phased

FROM dbo.OITM INNER JOIN

dbo._ItemMaster ON dbo.OITM.ItemCode = dbo._ItemMaster.[FOURTH SHIFT DATA] INNER JOIN

dbo._FSsalestots ON dbo._ItemMaster.F2 = dbo._FSsalestots.IMPN LEFT OUTER JOIN

dbo.[_YTD Sales] ON dbo.OITM.ItemCode = dbo.[_YTD Sales].ItemCode

WHERE dbo.OITM.ItemCode = '%0'

ORDER BY dbo.OITM.ItemCode