on 05-17-2016 3:51 PM
I need to pull a report of invoices within a date range that have specific tax codes in the rows. Here is what I have.
SELECT T0.[DocNum],T0.[DocDate], T1.[ItemCode], T1.[LineTotal], T1.[GrssProfit], T1.[TaxCode], T2.[CardName], T3.[SlpName], T0.[TrnspCode] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode
WHERE T0.[DocDate] >= [%0] AND T0.[DocDate] <= [%1]
AND T2.[GroupCode] = 3
AND T1.[TaxCode] = '93510'
OR T1.[TaxCode] = '91301'
It seems to work fine if I have only one tax code however when I add the, OR T1.[TaxCode] = '91301', it no longer respects the date range. Any help would be appreciated.
Or this:
AND (T1.[TaxCode] = '93510'
OR T1.[TaxCode] = '91301')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I would try to do this:
where taxcode in ('93510', '91301') and another conditions.
Kind regards
Agustín Marcos Cividanes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.