G
Gary Dolliver
Hi all,
I am attempting to pull out records that have two fields identical, and
later to be based on a date filter.
The main table is [orders], and the fields I want to check are OPID and OTN
- basically if OPID and OTN are the same in any records, to bring the
culprits to screen. OTN may be the same in other records, but it should only
"flag" if the combination of OPID and OTN are the same.
The date filter will be added later as I will then only want to check orders
that were created after the date, but still go back and check all the
history.
Finally, I will then want to also check the archive tables - the only
difference here is the table name is now [orders_archive] - but the fields
are the same
I tried starting with the duplicate SQL syntax found on this board, but I
keep getting syntax errors - i was using this:
SELECT * FROM [orders] WHERE [orders].[OTN] = IN(SELECT [orders].[OTN] FROM
[orders] AS [tmp]
GROUP BY [orders].[OTN] HAVING Count(*)>1;
Help is greatly appreicated!
-gary
I am attempting to pull out records that have two fields identical, and
later to be based on a date filter.
The main table is [orders], and the fields I want to check are OPID and OTN
- basically if OPID and OTN are the same in any records, to bring the
culprits to screen. OTN may be the same in other records, but it should only
"flag" if the combination of OPID and OTN are the same.
The date filter will be added later as I will then only want to check orders
that were created after the date, but still go back and check all the
history.
Finally, I will then want to also check the archive tables - the only
difference here is the table name is now [orders_archive] - but the fields
are the same
I tried starting with the duplicate SQL syntax found on this board, but I
keep getting syntax errors - i was using this:
SELECT * FROM [orders] WHERE [orders].[OTN] = IN(SELECT [orders].[OTN] FROM
[orders] AS [tmp]
GROUP BY [orders].[OTN] HAVING Count(*)>1;
Help is greatly appreicated!
-gary