Date Query

dwayne dibley

Registered User.
Local time
Today, 02:21
Joined
Oct 1, 2008
Messages
26
I'm currently trying to build a library type DB as part of a college course. The part I cant get to work I thought would be fairly simple, but whatever I try doesnt work.

Anyhow I have field named(loan date) which is preset as todays date and then another field which holds the amount of time the book can be loaned(which is variable, normally 7, 14 and 21) and from this I need to auto-populate the due date field.

I thought it would be a simple adding of the fields but that didnt work, I have also tried the dateadd field and I get the same result...............................nothing at all - the field stays blank.

I have tried doing this via expression builder. Any help will be very much apprieciated
 
Hey Cat!

This is a case where you should NOT be populating the due date field because you can calculate it at any time with the DateAdd function in a query. However, you have been up front about it being a school assignment and I'm sure that your instructor has required that the field is populated. This would cast my doubts on whether they know what they are doing enough to really teach you correctly (probably a smeghead). But, you would need to do this in a form and you can put code in the after update event of the other controls =

Me.YourFieldName = DateAdd("d",[YourFieldNameForDurationHere],[YourDateFieldNameHere])
 
Hey Cat!

This is a case where you should NOT be populating the due date field because you can calculate it at any time with the DateAdd function in a query. However, you have been up front about it being a school assignment and I'm sure that your instructor has required that the field is populated. This would cast my doubts on whether they know what they are doing enough to really teach you correctly (probably a smeghead). But, you would need to do this in a form and you can put code in the after update event of the other controls =

Me.YourFieldName = DateAdd("d",[YourFieldNameForDurationHere],[YourDateFieldNameHere])

Cheers Bob,

Thats makes sense, but I still cant get the fucking thing to work. I assume its something I am doing/not doing - its driving me nuts.

I recorded the expression as due_date = dateAdd([d], [loantype],[loandate]

Help!!
 
Glad you got it fixed.

Stick around. I'd hate to have your screen name lost in the shuffle. Not often we get a celebrity here.
 

Users who are viewing this thread

Back
Top Bottom