Not if credit was made in more than one payment.
:
Wouldn't a self-join be better? Seems to me it would simpler and more
straightforward to use:
(Untested)
SELECT [Unique#], Amount, [Balance Type]
FROM YourTable as YT1
LEFT OUTER JOIN YourTable as YT2
ON YT1.[Unique#]=YT2.[Unique#]
AND YT1.Amount= -YT2.Amount
AND YT1.[Balance Type] <> YT2.[Balance Type];
WHERE YT2.[Unique#] Is Null;
Self join on same unique id, negative of each other's amount and one
of
each
debit and credit, then exclude those that do in fact have such a
match..
Just a thought.
Petr
"KARL DEWEY" <
[email protected]> pÃÅ¡e v diskusnÃm
pÅ™ÃspÄ›vku Try this --
UniqueNotZero --
SELECT YourTable.Letter
FROM YourTable
GROUP BY YourTable.Letter
HAVING (((Sum(YourTable.QTY))<>0));
SELECT [Unique#], Amount, [Balance Type]
FROM YourTable JOIN UniqueNotZero ON YourTable.[Unique#] =
UniqueNotZero.[Unique#];
:
Karl,
I have one table with the following info:
Headers:
Unique#
Amount
Balance Type
Unique# | Amount | Balance Type
1001315 508.00 Debit
1001315 -508.00 Credit
1001315 472.00 Debit
So in this example, I am trying to match 508 Debit/Credit and
exclude
them
so that I only retrive 472.00
:
Need more input. Are there two table you are working with?
Post sample data like this --
Table1 --
435
-324
650
-123
Table2 --
-678
123
409
-427
:
Karl,
Thank you for the reply. Once I convert to Positive, how would
I
query to
exclude 508? Is there IF statements that can be used to state
if
508=508,then exclude?
Thanks,
CRU
:
Abs([YourField]) will make everything positive.
:
Scenario:
1. 5 Positive Value and 1 Negative Value.
2. 4 Positive value have different numbers. 1 Postive is
508.00
and 1
Negative is -508.00
Is there a function that will match negative 508 and
postive
508?
I need to
exclude those matching +/- values and export other 4
positive
value.
Any thoughts? Thanks.
CRU