sparkanother
New member
- Local time
- Today, 15:02
- Joined
- Mar 24, 2014
- Messages
- 5
[SOLVED] adding criteria to a query
Hi All,
I have one datatable and i have to list the duplicates from it based on different criterias. It contains invoices, we would like to avoid duplicated payments.
I'm struggling with a query. Basically i have a working one, i have to add one more criteria to filter out a couple of rows where the text column is "freight", but anyhow i have tried, it's not working. Without that one line where the not equal is, it's working as it should, when i'm adding that line it ruturns the same as before, but it should give me 108 less lines. The below one is based on an other query result called Duplicates_Rule1.
Here is the query:
Any help is appriciated!
Rgds,
Adam
Hi All,
I have one datatable and i have to list the duplicates from it based on different criterias. It contains invoices, we would like to avoid duplicated payments.
I'm struggling with a query. Basically i have a working one, i have to add one more criteria to filter out a couple of rows where the text column is "freight", but anyhow i have tried, it's not working. Without that one line where the not equal is, it's working as it should, when i'm adding that line it ruturns the same as before, but it should give me 108 less lines. The below one is based on an other query result called Duplicates_Rule1.
Here is the query:
Code:
SELECT * FROM Duplicates_Rule1
WHERE (((Duplicates_Rule1.BSEG_DocumentNo) In (SELECT [BSEG_DocumentNo] FROM [Duplicates_Rule1] As Tmp
GROUP BY [BSEG_DocumentNo]
HAVING Count(*)=1 ))
AND (Duplicates_Rule1.Check) Is Null)
and (Duplicates_Rule1.BSAK_Text <> "FREIGHT")
ORDER BY Duplicates_Rule1.BSEG_DocumentNo;
Any help is appriciated!
Rgds,
Adam
Attachments
Last edited: