Calculator query

Celtic Queen

Registered User.
Local time
Today, 18:43
Joined
Feb 26, 2003
Messages
29
Hiya,before the likes of my friend directormac start schreeching at me about going into Access Help to find the answers to my problems I would like to say that I've already done that=I spent hours=and I still couldn't find the answer to my question

OK,I have a table with the fields :
Item name 'Date taken out' 'Date due back' 'Number of days overdue' and 'Charge incurred by this item so far'

I want to know what to type in the query criteria so that the 'number of days overdue' field automatically subtracts the date in the 'date due back' field from the the current date

Thanx xxx
 
Firstly, you don't need a field in a table that holds the number of days overdue as this is calculable any time within a query, as is the date due back. In fact, the only field you really need is the one for date loaned out.

The function you are looking for is the DateDiff() function.

So you would create a new field in a query called DaysOverdue thusly:

DateOverdue: DateDiff("d", Date(), [Date Taken Out])
 
Ahhh,tiz my other friend (my bestest friend)!!!
I do need that field Mile-O-Phile,for report purposes
 
And I'm telling you right now, you don't!

You can base reports off the query where it calculates it for you.

If books have a four week loan period then you don't need to store the date due back as you can use the DateAdd() function to calculate 4 weeks in advance without ever storing the actual due back date.

You don't need to store the Days Overdue as you can calculate this from the date due back (also calculated).
 
oh ok,thank u
i gotsta go now,lesson.
I chat 2 u again 2morrow babes
Laterz
 

Users who are viewing this thread

Back
Top Bottom