cancel
Showing results for 
Search instead for 
Did you mean: 

query help

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks to both of you, Gordon and Bishal. It's working!

Shelby

Answers (1)

Answers (1)

Former Member
0 Kudos

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