Question : Design a Query to subtract a record value from previous record value

I have a table, tblAssets_Hrs_Miles, in which I record the details of my companies equipment usage.  A screen shot of the table is below.  Each time a piece of equipment is used, I record the asset_ID, Date it was used, the Hours shown on the hours meter at the end of the date and who used it.  I would like a query that shows how many hours an asset was used each day.  For instance, Asset #24 was used on 11/4/09 for 8 hrs.  The Hours at the end of 11/4 minus the hours the last time it was used which was 11/2. (366-358)
Can someone help me with this?  BTW, I don't know much SQL and have been trying to accomplish this using the query by example window.

Answer : Design a Query to subtract a record value from previous record value

Create a new Query in Access and paste this SQL:

SELECT maxDate.Asset_ID, maxDate.MaxOfUsage_Date, [all].End_of_Day_MI_Hrs, (SELECT TOP 1 End_of_Day_MI_Hrs FROM tblAssets_Hrs_Miles WHERE Asset_ID=maxDate.Asset_ID AND Usage_Datege_Date ORDER BY Usage_Date DESC) AS Last_End_of_Day_MI_Hrs, [End_of_Day_MI_Hrs]-[Last_End_of_Day_MI_Hrs] AS Hours_Used
FROM (SELECT Asset_ID, Max(Usage_Date) AS MaxOfUsage_Date
FROM tblAssets_Hrs_Miles
GROUP BY Asset_ID)  AS maxDate INNER JOIN tblAssets_Hrs_Miles AS [all] ON (maxDate.Asset_ID = [all].Asset_ID) AND (maxDate.MaxOfUsage_Date = [all].Usage_Date)
GROUP BY maxDate.Asset_ID, maxDate.MaxOfUsage_Date, [all].End_of_Day_MI_Hrs;
Random Solutions  
 
programming4us programming4us