Home > database >  Novice to validate access problems
Novice to validate access problems

Time:11-19

Two tables:
A table:
Gonghaowu name security initial value
11 zhang 100
22 li si 200
33 fifty and 300
.
Table b:
Gonghaowu name security accumulate date
11 in March 2018, zhang SAN - 1
22 in March of 2018 li si 0
33 fifty and 2 March 2018
11 zhang SAN 1 April 2018
22 li si 0 in April 2018,
33 fifty and 2 April 2018
11 zhang SAN 1 May 2018
22 li si 0 in May 2018,
33 fifty and 2 May 2018
.
Objective:
Will be per month "security accumulation" to carry on the stack, such as "security accumulation" negative Numbers, data reset, next month to accumulate,
To query for personnel in any "safe", in the following table:
Gonghaowu name TVC date
11 zhang SAN 2 May 2018
22 200 in May 2018, li si
33 fifty and 306 in May 2018,
.
Note: zhang SAN's initial value is 100, due to the negative in March 2018, therefore, in April 2018 on May 1, so is 100-100 + 1 + 1=2, li si three months above 0, so it is 200 + 0 + 0 + 0=200, li si is 300 + 2 + 2 + 2=303
Staff is not much, but time is very long, need to be from five years ago, behind will continue, b will increase over time, the corresponding data table, of course,
How to use the access to achieve this purpose, please expert advice, even the solution at present, give a way of thinking is fine, thank you very much
  • Related