John, thanks for your explainations - I learned a little more and it all helps
rp
----- John Nurick wrote: ----
Inline
On Mon, 24 May 2004 19:36:04 -0700, RP
Hi John
battery being installed in one truck, where it may remain for zero o
more charge/discharge cycles?
does not remain through charging cycles. I was thinking that placin
batteries into trucks was a separate topic from charging the battery
One battery might be installed in one truck where it remains until it i
removed. Any given battery might be removed from one truck and place
into another, or it might be removed and placed onto the charger (a
opposed to remaining in the truck during the re-charging period whic
would make the truck unavailable). Plus, I figured that because Bill
mentioned that dead batteries were coming off the trucks that th
charging did not take place on the truck. After the battery i
re-charged it might then be installed into another, different truck
We both understood Bill the same way: (a) A battery is removed from it
current truck before being charged. (b) Once it's charged it can b
installed in any suitable truck. (c) Batteries are only used in trucks
If we're right, there's no need for independent tracking of "the histor
of installing batteries in trucks" and "the history of charging an
discharging batteries", because you can't charge a battery withou
having removed it from a truck, and you can't use a battery withou
installing it in a truck.
Next, why does your Battery History table not include the BatteryID
This means that to get the history of a battery you have to write
query that joins tblTruckBattUsage and tblBattHistory in order to trac
a battery through all the Truck Battery Usage records in which i
appears. This seems perverse.
Substitute "wrong" if you prefer<g>. But I was just referring to th
idea of a table that recorded events that happen to individual batterie
without storing the BatteryID.
Although I don't know if you mean the mis-guided table design or the
query of both usage and history tables. In either case, I'm glad that
I asked - you're right, it should be a BatteryID (and not a UsageID)
As far as querying both table records, I guess I read the proble
differently than you - Usage and Charging History as separate topics.
interpreted "fresh batteries" as "re-charged batteries" rather than "ne
batteries". I interpreted dis-charged (or "dead") batteries as remove
from the truck and placed onto a charger. Under that scenario, if yo
wanted to know which batteries are available for putting into anothe
truck, you'd need to know if each particular battery was already on
truck, freshly charged, or charging on a charger, so wouldn't you stil
have to search both the usage records and the charging records? Or i
that the kind of thinking you meant was 'perverse'
As I said above, we seem to agree on the scenario; and if we've got tha
right I don't see the need for tracking charging events independently o
discharging events. Even if (which seems not to be the case) a batter
may be installed in one truck, used a bit, and then installed in anothe
without being charged, the structure I proposed can handle it (perhap
with the addition of one more field tblBatteryCycles).
Also, you're underplaying the importance of fields such as DateInst b
putting them in brackets with the "other" fields. When you're storing a
series of events, their datestamps often should be included in the
table's primary key; certainly they will need to be included in a
multi-field unique index.
However, I don't understand 'why' it should be a part of the PK or unique index.
I suspect that an explanation would be lengthy. If you don't have the
time to explain it, is it possible that you could direct me to a link, a
chapter in a book, or article that explains it?as part of the PK prevent inadvertant duplication of records?
Just that.
but there's nowhere to track when and whether a battery has been charged
.... and therefore no way of choosing which battery to use next. So
you're pretty much forced to use a "battery cycle" concept in some
fashion.
responded with a different layout (sans any explanation of the tables).
On my post I had expressed a lack of confidence in what information
could be queried out of the table records. If you don't mind, take a
look at these tables and see if they will allow for queries that
determine which batteries are charged, which are in use and in which
truck, and who did the install and re-charge work for each battery.
(I'm trying to strengthen my table design skills and have not worked
much on my query skills yet.)
There are currently only two types of trucks, but this table allows for adding more types.
tblTruckType
TtypeID
(Brand, other descriptive fields…)
This table holds your truck inventory -have as many as you need.
tblTrucks
TruckID
TtypeID
(PurchDate, other descriptive fields…)
This table holds the types of batteries - again, currently only two but could be increased for more.
tblBattType
BtypeID
(Brand, other descriptive fields…)
This table holds your battery inventory - have as many as you need.
tblBattInventory
BattID
BtypeID
(DateRec, DateDestroyed, other descriptive fields…)
This table is the junction table between trucks and batteries. You record what battery went into which truck, when it went in, and when it came out. You can assign as many batteries as you want (two?) to a particular truck by each battery installation having its own usageID.
tblTruckBattUsage
UsageID
TruckID
BattID
EmpID
(DateInst, DateRemoved, HoursUsed, other descriptive fields…)
This table records the type of charger - currently two brands but this allows for expansion.
tblChargerType
ChgrTypeID
(Brand, other descriptive fields…)
This table records your charger inventory.
tblCharger
ChgrID
ChgrTypeID
(Brand, DatePurch, other descriptive fields…)
This table records the employees - it is available here so you can track who worked on the installation or charging of the batteries.
tblEmployee
EmpID
(FirstName, LastName, Position [could be another table?], other descriptive fields…)
This table records the re-charging of each battery. The usageID is in this table because I figured that each battery would/should be charged upon removal from a truck.
tblBattHistory
HistID
UsageID
ChgrID
EmpID
(DateChgd, other descriptive fields…)
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.