Solved

MS Access Sql Queto associate values from different rows

Posted on 2016-09-15
3
52 Views
Last Modified: 2016-09-26
Experts,

I'm converting Payroll data from our old system to a new one. In the old system, when an employee moved to a new state, the State tax was recorded in the new state, but the YTD State Tax balance from the old state was coded as Previous State YTD tax (PRVST). In the new system, I need to map the PRVST to the state that the YTD balance was actually in, so in this case, to ST1MD


Old System                                                                                     Maps To in New System:
DateEnd           EmpID     Tax Code        Curr Tax    YTD Tax      Tax Code
8/31/2015        05961        ST1MD           $500        $3500            MD
9/15/2015        05961        ST1VA             $500        $ 500             VA  
9/15/2015        05961        PRVST                  $0       $3500            MD (How do I associate this $3500 with MD?)

Attached is some example data. There's about 870,000 lines on this table, but I think there are only about 250 PRVST codes

Thanks in advance
EE-Question-PRVST.xlsx
0
Comment
Question by:Ron
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
John Tsioumpris earned 500 total points
ID: 41801209
Well i have some kind of solution but i am not sure if this what you want.
Take a look at the attached accdb(zipped) -- Access 2013...if you have earlier version tell me to convert it.
I have imported your sheet. and then i have found the entries where previous tax is 0 and the amount of current tax(probably i am wrong about the definitions)
Then i get the entry from the previous state according to the amount and finally i update the data to fill with the previous state---> take a look at table FinalTest....
Database5.zip
0
 

Author Comment

by:Ron
ID: 41806481
That works. Thanks
0
 

Author Closing Comment

by:Ron
ID: 41816690
thanks
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now