on 05-07-2015 7:51 AM
Hi Experts,
I trying this below query
SELECT T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType] FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId INNER JOIN OACT T2 ON T1.Account = T2.AcctCode WHERE T2.[GroupMask] in (4,5) and T1.[OcrCode3] IS NOT NULL and T0.[RefDate] >=[%0] AND T0.[RefDate] <=[%1]
GROUP BY T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType]
Whereas though i have defined where condition for T1.[OcrCode3] IS NOT NULL . Still it is listing me the null OcrCode3 lines.
What could be issue ?
Thanks in advance,
Regards,
Dwarak
Hi,
Try this
SELECT T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType]
FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId INNER JOIN OACT T2 ON T1.Account = T2.AcctCode
WHERE T2.[GroupMask] in (4,5) and (T1.[OcrCode3] IS NOT NULL or T1.[OcrCode3]<>'') and T0.[RefDate] >=[%0] AND T0.[RefDate] <=[%1]
GROUP BY T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType]
--Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use only T1.[OcrCode3]<>''
SELECT T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType]
FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId INNER JOIN OACT T2 ON T1.Account = T2.AcctCode
WHERE T2.[GroupMask] in (4,5) and T1.[OcrCode3]<>'' and T0.[RefDate] >=[%0] AND T0.[RefDate] <=[%1]
GROUP BY T0.[TransId], T1.[Account], T2.[AcctName], T1.[Debit], T1.[Credit], T1.[OcrCode3], T0.[TransType]
--Manish
User | Count |
---|---|
110 | |
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.