PC Review


Reply
Thread Tools Rate Thread

How do I tell an update query to do until it should stop!!

 
 
=?Utf-8?B?U2lkeg==?=
Guest
Posts: n/a
 
      13th Apr 2006
Hey,
I have an update query that adds a certain number of dates to dates from a
table. I want the query to keep on adding dates to the first date until it
reaches or exceeds 31/12/2006. How do I do this?
Please note, the query will need to create new records too, since the user
will only be inputting the start dates!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SyBEYWxlcw==?=
Guest
Posts: n/a
 
      13th Apr 2006
If you need to add records you can't do it with an update query; you would
need an append query. But append queries are really designed to merge new
records already created with the existing records, not to "dynamically"
create new records as you are describing; especially not a variable number of
multiple new records. I think the task is too complex for a simple query and
the better solution is to create your new records via a macro or VBA code.

To give details I would need to know how the process is to be initiated (how
is your user entering the date; is it from a form?) and also how you know
what dates to add to your database (are you adding new records for each day
up to 3/12/2006, or every week, month, ?) and also if any other information
needs to go into these new records.
--
- K Dales


"Sidz" wrote:

> Hey,
> I have an update query that adds a certain number of dates to dates from a
> table. I want the query to keep on adding dates to the first date until it
> reaches or exceeds 31/12/2006. How do I do this?
> Please note, the query will need to create new records too, since the user
> will only be inputting the start dates!

 
Reply With Quote
 
=?Utf-8?B?U2lkeg==?=
Guest
Posts: n/a
 
      14th Apr 2006
Let me try to explain the project to you.

This is a booking system for a community centre. The centre is usually
rented out to individuals or organisations, but at the start of every year,
the Committee decides on a group of organisations to hold their activities
there for free. These bookings are made for the whole year. The intervals
between each of their activities vary from Year to Year. here is the list for
this years activites:

Play Group: Monday and Wednesday Mornings
Guides and Brownies: Tuesday Evening
Cubs and Scouts: Thursday Evening
Women's institute: Third Tuesday in every month
Line Dancing: every other Monday Evening.

The user will be inputting the dates via a form. The user should insert the
first booking date for each of the activities, their time intervals, and then
the last date until which bookings need to automatically made! All values
need to be dynamic since the number of sundays, saturdays, etc varies from
year to year!

A bit about the system I have now:
The details of these organisations are held in the tblClient.
All booking details need to stored in the tblBookings, which is linked with
the tblClient via ClientID and the tblSlot via the SlotID
The tblSlot holds details of the booking slots - there are only 21 slots
available per week (three shifts a day - morning, afternoon, evening). Thus
this table only has 21 records. Each slot has its own unique SlotID (Monday
Morning being one Slot, while Monday Afternoon is another!)

I would be very grateful if you could help me or point me in the right
direction. I don't know much about VB, but I guess I can follow a book!

Thanks for taking time to read! ;-)

"K Dales" wrote:

> If you need to add records you can't do it with an update query; you would
> need an append query. But append queries are really designed to merge new
> records already created with the existing records, not to "dynamically"
> create new records as you are describing; especially not a variable number of
> multiple new records. I think the task is too complex for a simple query and
> the better solution is to create your new records via a macro or VBA code.
>
> To give details I would need to know how the process is to be initiated (how
> is your user entering the date; is it from a form?) and also how you know
> what dates to add to your database (are you adding new records for each day
> up to 3/12/2006, or every week, month, ?) and also if any other information
> needs to go into these new records.
> --
> - K Dales
>
>
> "Sidz" wrote:
>
> > Hey,
> > I have an update query that adds a certain number of dates to dates from a
> > table. I want the query to keep on adding dates to the first date until it
> > reaches or exceeds 31/12/2006. How do I do this?
> > Please note, the query will need to create new records too, since the user
> > will only be inputting the start dates!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Stop Acces From Update The Record When The Subform Query Is On Focus? Chipcom Microsoft Access 8 30th Apr 2007 06:25 PM
Stop Excel's UPDATE\Don't UPDATE message box from appearing every time I open the work book divya Microsoft Excel Programming 2 12th Jul 2006 08:20 AM
Stop to modify the SQL query manually entered into query ! =?Utf-8?B?T2xpdmllciBSb2xsZXQ=?= Microsoft Excel Programming 6 3rd Nov 2004 08:34 AM
After update to XP Pro - cannot stop it trying to update to Win DVD6 WHR Windows XP Setup 1 23rd Sep 2004 03:33 PM
How to stop Windows Update from prompting for a particular update? Chris Windows XP General 6 11th Sep 2003 11:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 PM.