1

Topic: How to deduce units, which now in operation?

Hello, I the beginning user. There was a problem, it is necessary to learn what units now are in operation. There are tables arrival of units, closing of units. The unit has a manager No. I think so, the first record from Arrival undertakes, the manager No is checked with . from Closing if coincidence is not present it is deduced if there is a coincidence then the unit is written off, it is not necessary to deduce. Somehow so. But how to implement I can not understand. In advance thanks

2

Re: How to deduce units, which now in operation?

Fes62;
On idea the Table the Factory unit should be one, on it the subordinate table History is hung up:
- Date
- State (arrival, closing, write-off, reset...)
- The document (a waybill, the act....)

3

Re: How to deduce units, which now in operation?

You search then those at which for a state arrival or in operation

4

Re: How to deduce units, which now in operation?

Pancake, it is natural on high date (did not wake up still)

5

Re: How to deduce units, which now in operation?

vmag, did not understand about high date a little, can explain please?)

6

Re: How to deduce units, which now in operation?

Fes62;
- If the history is not necessary to you, also the history table is not necessary, enough in in the block table of one field "a unit State" which can accept values (in operation, is closed, etc.)
- If the unit history is necessary to you (when the unit has been received, when is closed...) on the table the unit is hung up the subordinate table History, for example for the unit No 1:
- The first record of history: 1/1/2018; In operation; the Waybill No1
While this record in the history for this unit unique request on the maximum date of a state of the unit will always produce a state the Unit No 1 - in operation.
- Now there is a second record in the history for the unit No 1: 2/20/2018; It is closed; the Act No1
From this point on the maximum date in the history of the unit No1 2/20/2018 and its state "is closed"