V
vandy
Hi All,
I have a database that keeps track of tools in the Tool Store.
Borrowers information
tblnamepk
id,Name,Department
tbltooltransaction
TranID-pk
NameID - FK for tblname
TranToolID - FK for tbltoolmaster
DateTaken - date tool was taken
DateReturned - date tool was returned
Status - available / loaned
tbtoolmaster
ToolID - pk
Toolno
ToolDesc
Manufacturer
ModelNo
SerialNo
Location
Relationship
tblname ~ tbltooltransaction
ID ~ NameID
tbltoolmaster ~ tbltooltransaction
ToolID ~ TranToolID
I am recording the transaction data who burrowed it , when and if the tool
is available or loaned.
When i query for available:
SELECT tbltoolmaster.NumetNo, tbltoolmaster.ToolDesc,
tbltoolmaster.Manufacturer, tbltoolmaster.ModelNo, tblname.Name,
tbltooltransaction.DOI, tbltooltransaction.DOR, tbltoolmaster.Location,
tbltooltransaction.Status
FROM tbltoolmaster INNER JOIN (tblname INNER JOIN tbltooltransaction ON
tblname.ID = tbltooltransaction.NameID) ON tbltoolmaster.ToolID =
tbltooltransaction.TranToolID
GROUP BY tbltoolmaster.NumetNo, tbltoolmaster.ToolDesc,
tbltoolmaster.Manufacturer, tbltoolmaster.ModelNo, tblname.Name,
tbltooltransaction.DOI, tbltooltransaction.DOR, tbltoolmaster.Location,
tbltooltransaction.Status
HAVING (((tbltooltransaction.Status)="Available"))
ORDER BY tbltoolmaster.NumetNo;
than all tools that are available are listed but once I loaned the tool and
run the loaned query it still shows the previous transaction for this tool as
available.
and next transaction as loaned.
eg.
ET-2 10/30/2007 11/01/2007 available
ET-2 11/02/2007 loaned
Loaned qry i get ET-2 as taken on 11/02/2007 and Date of Return is null
and available I get the date taken and returned.
Ideally once the tool is loaned i should have got returned on this date but
now loaned and not in the inventory.
Please help me out in sorting this logic.
thanks in advance
I have a database that keeps track of tools in the Tool Store.
Borrowers information
tblnamepk
id,Name,Department
tbltooltransaction
TranID-pk
NameID - FK for tblname
TranToolID - FK for tbltoolmaster
DateTaken - date tool was taken
DateReturned - date tool was returned
Status - available / loaned
tbtoolmaster
ToolID - pk
Toolno
ToolDesc
Manufacturer
ModelNo
SerialNo
Location
Relationship
tblname ~ tbltooltransaction
ID ~ NameID
tbltoolmaster ~ tbltooltransaction
ToolID ~ TranToolID
I am recording the transaction data who burrowed it , when and if the tool
is available or loaned.
When i query for available:
SELECT tbltoolmaster.NumetNo, tbltoolmaster.ToolDesc,
tbltoolmaster.Manufacturer, tbltoolmaster.ModelNo, tblname.Name,
tbltooltransaction.DOI, tbltooltransaction.DOR, tbltoolmaster.Location,
tbltooltransaction.Status
FROM tbltoolmaster INNER JOIN (tblname INNER JOIN tbltooltransaction ON
tblname.ID = tbltooltransaction.NameID) ON tbltoolmaster.ToolID =
tbltooltransaction.TranToolID
GROUP BY tbltoolmaster.NumetNo, tbltoolmaster.ToolDesc,
tbltoolmaster.Manufacturer, tbltoolmaster.ModelNo, tblname.Name,
tbltooltransaction.DOI, tbltooltransaction.DOR, tbltoolmaster.Location,
tbltooltransaction.Status
HAVING (((tbltooltransaction.Status)="Available"))
ORDER BY tbltoolmaster.NumetNo;
than all tools that are available are listed but once I loaned the tool and
run the loaned query it still shows the previous transaction for this tool as
available.
and next transaction as loaned.
eg.
ET-2 10/30/2007 11/01/2007 available
ET-2 11/02/2007 loaned
Loaned qry i get ET-2 as taken on 11/02/2007 and Date of Return is null
and available I get the date taken and returned.
Ideally once the tool is loaned i should have got returned on this date but
now loaned and not in the inventory.
Please help me out in sorting this logic.
thanks in advance