K
KERRY J
I have a db that contains the tables tblTank-Daily (daily measurements
for a series of physical tanks that hold fluids) and tblTankTable
(which essentially is a lookup table containing volume data for a given
gauge measurement for a given tank). The Tanks are gauged daily (in
feet and inches) to determine the volume of fluid (in barrels).
I am trying to build a query that will show the volume for two
different dates; (selected date and selected date - 1). Ultimately, I
want to build an expression which will subtract the (selected date - 1)
volume from the (selected date) volume to determine a daily production
value.
I built the query to show the volume for one day (sql shown below) but
haven't been able to figure out how to pull two days.
SELECT [tblTank-Daily].tankID, [tblTank-Daily].date,
[tblTank-Daily].[gauge-Feet], [tblTank-Daily].[gauge-Inches],
tblTankTable.volumeBBL
FROM tblTankTable INNER JOIN [tblTank-Daily] ON tblTankTable.tankID =
[tblTank-Daily].tankID
WHERE ((([tblTank-Daily].date)=[Enter Date (mm/dd/yy):]) AND
(([tblTankTable]![gauge-Feet])=[tblTank-Daily]![gauge-Feet]) AND
(([tblTankTable]![gauge-Inches])=[tblTank-Daily]![gauge-Inches]));
Thanks in advance for any help!
for a series of physical tanks that hold fluids) and tblTankTable
(which essentially is a lookup table containing volume data for a given
gauge measurement for a given tank). The Tanks are gauged daily (in
feet and inches) to determine the volume of fluid (in barrels).
I am trying to build a query that will show the volume for two
different dates; (selected date and selected date - 1). Ultimately, I
want to build an expression which will subtract the (selected date - 1)
volume from the (selected date) volume to determine a daily production
value.
I built the query to show the volume for one day (sql shown below) but
haven't been able to figure out how to pull two days.
SELECT [tblTank-Daily].tankID, [tblTank-Daily].date,
[tblTank-Daily].[gauge-Feet], [tblTank-Daily].[gauge-Inches],
tblTankTable.volumeBBL
FROM tblTankTable INNER JOIN [tblTank-Daily] ON tblTankTable.tankID =
[tblTank-Daily].tankID
WHERE ((([tblTank-Daily].date)=[Enter Date (mm/dd/yy):]) AND
(([tblTankTable]![gauge-Feet])=[tblTank-Daily]![gauge-Feet]) AND
(([tblTankTable]![gauge-Inches])=[tblTank-Daily]![gauge-Inches]));
Thanks in advance for any help!