P
Phantom_guitarist
I have set up a database which has a list of miles done each month and
another table which has a list of all petrol reciepts. What I am looking at
doing is transfering the petrol reciepts across from one table to the
mileage table. Sounds simple. The problem occurs when for example petrol
is purchased over the weekend but no mileage was done for that day (as only
business miles are recorded). What I wont to happen is for it to be added
to the next working day or the next day I do business miles. Currently I am
trying to use DLOOKUP to bring the amounts across in a query but for some
reason it doesn't seem to work how I expect it to.
Table 1 tblDriver log
date destination miles petrol
21/2 Glasgow 56
22/2 Inverness 32
09/3 Ayr 87
etc
Table 2
date petrol reciept
21/2 £21.56
22/2 £30.23
08/3 £15.44
example of the expression in query
Expr1: DLookUp("[Date]","tblDriver log","[Date] = #"&[Date2]&"#")
where [date2] is the date from table2
I no this will just find the matching date but for some reason it doesn't
work. When I run the query it only matches some of the records. Any ideas?
Any one used Dlookup before with dates? I thought it should work. Or any
other suggestions?
another table which has a list of all petrol reciepts. What I am looking at
doing is transfering the petrol reciepts across from one table to the
mileage table. Sounds simple. The problem occurs when for example petrol
is purchased over the weekend but no mileage was done for that day (as only
business miles are recorded). What I wont to happen is for it to be added
to the next working day or the next day I do business miles. Currently I am
trying to use DLOOKUP to bring the amounts across in a query but for some
reason it doesn't seem to work how I expect it to.
Table 1 tblDriver log
date destination miles petrol
21/2 Glasgow 56
22/2 Inverness 32
09/3 Ayr 87
etc
Table 2
date petrol reciept
21/2 £21.56
22/2 £30.23
08/3 £15.44
example of the expression in query
Expr1: DLookUp("[Date]","tblDriver log","[Date] = #"&[Date2]&"#")
where [date2] is the date from table2
I no this will just find the matching date but for some reason it doesn't
work. When I run the query it only matches some of the records. Any ideas?
Any one used Dlookup before with dates? I thought it should work. Or any
other suggestions?