on 03-10-2009 3:49 PM
Hi, all-
Wondering if anyone can help me with the following query? When I run this using a date of 3/9/09, I get all dates instead of 3/9//09. Problem arose when I added several GLDiv fields instead of using just one - up until then it worked fine. I'm trying to see deliveries for a specified date by division, and in this case, I want to see 4 divisions on one report (this is the U_ABBA_GLDiv field).
What do I need to tweak?
SELECT T0.[DocNum], T0.[U_ABBA_SONum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T0.[U_ABBA_ShipName], T0.[U_ABBA_ShipAttn], T0.[U_ABBA_ShipCity], T0.[U_ABBA_ShipState] FROM ODLN T0 WHERE T0.[DocDate] =[%] AND T0.[U_ABBA_GLDiv] = '3-Whsl' OR T0.[U_ABBA_GLDiv] = '4-C2' OR T0.[U_ABBA_GLDiv] = '6-Retail' OR T0.[U_ABBA_GLDiv] = '7-Rugged'
Thanks,
Shelby
Try this one:
SELECT T0.DocNum, T0.U_ABBA_SONum, T0.DocDate, T0.CardCode, T0.CardName, T0.NumAtCard, T0.U_ABBA_ShipName, T0.U_ABBA_ShipAttn, T0.U_ABBA_ShipCity, T0.U_ABBA_ShipState
FROM DBO.ODLN T0 WHERE T0.DocDate =[%0\] AND (T0.U_ABBA_GLDiv = '3-Whsl' OR T0.U_ABBA_GLDiv = '4-C2' OR T0.U_ABBA_GLDiv = '6-Retail' OR T0.U_ABBA_GLDiv = '7-Rugged')
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can try this
SELECT T0.DocNum, T0.U_ABBA_SONum, T0.DocDate, T0.CardCode, T0.CardName, T0.NumAtCard, T0.U_ABBA_ShipName, T0.U_ABBA_ShipAttn, T0.U_ABBA_ShipCity, T0.U_ABBA_ShipState FROM ODLN T0 WHERE T0.DocDate =[%] AND T0.U_ABBA_GLDiv in( '3-Whsl' , '4-C2', '6-Retail', '7-Rugged')
Hope this helps
Bishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.