View Full Version : Prompt for Date then inserting date into multiple fields


chineebai
01-05-2010, 06:41 AM
I have this make table query I run but I want to add in 4 additional fields to it. They are date1, date2, date3, and date4. How do I prompt it for a date range so that the user can input for example, 12/01/2009 and then input 01/01/2010 where 12/01/2009 is inserted into date1,2,3 and 01/01/2010 is inserted into date4?

Any help is appreciated thanks

Brianwarnock
01-05-2010, 07:11 AM
I would use a form to drive the query then you can easily manipulate the controls.

however if you have date1:[enterdate1] in 1 column of your design grid the date2:[date1] etc , and date4:dateadd("m",1,[date1]) will give you what you want

sorry you didn't add amonth you need dateserial(year([date1]),month([date1])+1,1)

Brian

chineebai
01-05-2010, 07:20 AM
I would use a form to drive the query then you can easily manipulate the controls.

however if you have date1:[enterdate1] in 1 column of your design grid the date2:[date1] aetc and date4:dateadd("m",1,[date1]) will give you what you want

Brian


I'm sorry but i am having trouble what you mean. What is date4:dateadd("m",1,[date1])? what does that do?

Brianwarnock
01-05-2010, 07:21 AM
In the design grid

date1:[enterdate]
date2:date1
date3:date1
date4:dateserial(year(date1)+1,month(date1),1)

Brianwarnock
01-05-2010, 07:22 AM
I appear to have had a bit of trouble with my posts please reread them

Brian

chineebai
01-05-2010, 07:28 AM
I appear to have had a bit of trouble with my posts please reread them

Brian
okay i got it, thank you so much