On Jul 20, 2015, at 23:52, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Good evening to all,
I have a question, I try to explain hoping that somebody can give me some solution as happen in the past.
I have a 2 tables, one main table that I call Tblopencredit and another one called TblopencreditOLD that stock previous version of the record and it is fulfilled each time the records in main table, change.
The table has the following fields:
key
information field
creation date
modification date
each time the record in table Tblopencredit is changed, the previous record is copied and saved in table tblopencreditSTO and the date when change occur is reported in "modification date" field of tblopencreditSTO.
below one example of record in tblopencredit
(the format of the date is dd/mm/yyyy)
1; 900; 03/03/2015;10/07/2015;
2;1000; 1000; 11/02/2015; 11/02/2015
3;1500; 06/07/2015; 11/02/2015
In reality in my database the date is reported also with seconds that I deleted to simplify
Below an example of tblopencreditSTO where the record with key 1 has been changed 3 times and the other record did not have any change and consequently there are no record in tblopencreditSTO
1;1000; 03/03/2015;10/07/2015
1;800; 03/03/2015; 15/07/2015
1;200; 03/03/2015; 18/07/2015
My goal is retrieve the data how was in a precise given date
For example if I want to know how was data the 17/07/2015 (July 17)
This mean that I need to take the record 1 in tblopencreditSTO (second position with changing date: 15/07/2015)
And for record 2 and 3 I need to take the data in tblopencredit because the record were created before the query date and did not occur any modification.
I can also merge the two tables in only one table but I need a way to extract only one record for each key that fit my question "How was the data in a certain date)
Any Idea?
Thank you
Valentino
Posted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar