I got this subquery to work to insert a field called PreviousOdometer that would enter in the record before its odometer mileage. but my records also have a fuelTime field because most trucks are filled up in the morning and the evening. so I will have two dates that are the same but separate times.Code:PriorOdometer: (SELECT MAX([odometerMiles]) FROM [FuelCards] AS [PreviousCards] WHERE [PreviousCards].[fuelDate] < [FuelCards].[fuelDate], AND [PreviousCards].[truckNumber] = [FuelCards].[truckNumber])
I am terrible at sql and have no idea how to add in the time field.
Can anyone help me?