fattyfatpants
Programmer
I have a SQL statement as follows
for some reason this omits a lot of results, however if I leave out the AND (arage4 + arage5 >= 1000) it brings in all of the results I am looking for plus more...Why?? I hope I am making sense...Thanks ahead of time.
Code:
'dw_xaraged = Data Warehouse table
'clients = Clients table
'matter = Services for each client
'relationships: client 1..N matter | matter 1..N dw_xaraged
'mmatter = Specific service for each client (ie Tax Return, Financial Statement, etc.)
'arage1, arage2, arage3, arage4, arage5 = 0, 30, 60, 90, 120 days past due on payments and how much is owed in each
'araget = total amount outstanding
'mdesc1 = description of service rendered to client
'clientaddr1 = client name
'morgaty = originating attorney for the client
SELECT dw_xaraged.mmatter, arage1, arage2, arage3, arage4, arage5, araget, mdesc1, clientaddr1, morgaty
FROM dw_xaraged INNER JOIN (clients INNER JOIN matter ON clients.clnum = matter.mclient) ON dw_xaraged.mmatter = matter.mmatter
WHERE peendt = '9/30/2004'
AND (arage4 + arage5 >= 1000)
ORDER BY morgaty, crelated, dw_xaraged.mmatter
for some reason this omits a lot of results, however if I leave out the AND (arage4 + arage5 >= 1000) it brings in all of the results I am looking for plus more...Why?? I hope I am making sense...Thanks ahead of time.