Find a record AND the one immediately above it for bad GL postings

M

M.M.

I am trying to locate a posting error in our GL table. The error in question
can be located when the line posted immediately before the freight
(GLAccount 603750) is GLAccount 785099 (Exchange). The ID field is an
autonumber so I guess it can be used to get ID -1

I'd like the query results to include
SELECT [GL].ID, [GL].[GLAccount], [GL].Date, [GL].Code, [GL].[D/C],
[GL].Amount, [GL].DB, [GL].CR, [GL].PostDate, *
FROM [GL]

I'm just not sure what the WHERE is so that will end up with only the
entries for GLAccount 785099 when it occurs the line before ID -1 GLAccount
603750 Based on these results I can collect all the bad entries and sum them
up to correct.

Many thanks in advance

M
 
G

Guest

Why not open the table in datasheet view - click on the binoculars and find
GLAccount 785099?

Then scroll up and down a few records.
 
G

Guest

create a query with two copies of the GL table. Don't
join them. Add the criteria GL.ID = GL_2.ID - 1

If that runs to slowly, then Join the GL table to the copy
of the GL table on the autonumber primary key

Then go into SQL view and change the join expression

from GL inner join GL as GL2 on GL.id = GL2.id
to (GL.id = GL2.id -1)

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top