Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 One more query help

Author  Topic 

Rita Bhatnagar
Posting Yak Master

172 Posts

Posted - 2002-04-25 : 16:28:24
The last Statement after And is not right.
Any Suggestions?
Thanks.
SELECT DISTINCT B.ChargeLinkNumber
FROM (BillingSetup AS A
INNER JOIN BillingSource AS B ON A.BillingSetupID = B.BillingSetupID)
LEFT JOIN Reversals AS C ON A.ReversalID = C.ReversalID
WHERE A.CompanyEntityID = @prmCompanyEntityID AND
(A.LastBillingTrackingID = 0 And A.ReversalID =0) OR
( A.ReversalID > 0 )
And (C.ReversalBillingTrackingID = 0 <> A.LastBillingTrackingID = 0))
GROUP BY B.ChargeLinkNumber

Peter Dutch
Posting Yak Master

127 Posts

Posted - 2002-04-26 : 02:16:15
Really depends on what you want.

Check the () in your WHERE statement. I can't give you the solution because I don't know how you want to evaluate the AND's and OR's.

Go to Top of Page
   

- Advertisement -