on 2013 Dec 09 8:16 AM
Hi SQL Experts. I've written a query to display items in a particular Row and can choose eg A to D rows. What I want to do now is to be able to select the sub levels and select eg: A12 to D14.
I'm on V9 PL07 Can anyone help? This is what I have so far:
select t0.ItemCode, t1.ItemName, isnull(t3.OnHandQty,0) as 'On Hand', t2.BinCode, t2.SL1Code, t2.SL2Code, t0.WhsCode from OITW T0
inner join OITM t1 on t0.ItemCode = t1.ItemCode
inner join OBIN t2 on t2.AbsEntry = T0.DftBinAbs
left outer join OIBQ t3 on t0.ItemCode=t3.ItemCode and t0.WhsCode = t3.WhsCode
where t2.SL1Code between '[%0]' and '[%1]'
order by t2.SL1Code, t2.SL2Code, t0.ItemCode
Thanks
Request clarification before answering.
Hi,
Could you show the result of your current query? What parameter you have put in?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First try:
select t0.ItemCode, t1.ItemName, isnull(t3.OnHandQty,0) as 'On Hand', t2.BinCode, t2.SL1Code, t2.SL2Code, t0.WhsCode from OITW T0
inner join OITM t1 on t0.ItemCode = t1.ItemCode
inner join OBIN t2 on t2.AbsEntry = T0.DftBinAbs
left outer join OIBQ t3 on t0.ItemCode=t3.ItemCode and t0.WhsCode = t3.WhsCode
where t2.SL2Code LIKE '[%0]%'
order by t2.SL1Code, t2.SL2Code, t0.ItemCode
You may enter 'A', 'B', 'C', or 'D' to see what you get. Your range is not an actual range from data view. A work around is need to create the condition. I don't have the environment to test for you.
| User | Count |
|---|---|
| 27 | |
| 14 | |
| 13 | |
| 6 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.