Booking Query

rushhour

Registered User.
Local time
Yesterday, 19:09
Joined
Nov 5, 2008
Messages
13
Hi

I need help with queries in MS Access 2003. I am creating a booking system and need to show all dinner bookings for the coming week. Does anyone have any ideas on how to go about this? The query should show the customer's forename and surname, time and number of dinners all for the coming week eg. week beginning 06th October 2008-12th October 2008. It would also need to show them for other weeks of course and not just for that week.

Thanks in advance.
 
As a starter, this:

Code:
? date() - WeekDay(date()) + 2 + IIf(WeekDay(date()) >= 2, 7, 0)

... will return the next Monday (Sun = 1, Mon = 2 thru Sat = 7)

adding 6 days to that date will return the following Sunday.

Need a little more info on your query to provide a concise answer.

HTH - Bob
 
As a starter, this:

Code:
? date() - WeekDay(date()) + 2 + IIf(WeekDay(date()) >= 2, 7, 0)
... will return the next Monday (Sun = 1, Mon = 2 thru Sat = 7)

adding 6 days to that date will return the following Sunday.

Need a little more info on your query to provide a concise answer.

HTH - Bob

Thanks for your reply well basically the question asks the following to be completed:

1.[FONT=&quot] [/FONT]To show all the Dinner bookings for the coming week including Customer names, time and number of diners using the query wizard.


2. As above, but using the design query to show only the bookings of a particular Account Customer during the last four weeks.
 
Try copying/pasting this as the criteria for your date field:

Code:
Between Date()-Weekday(Date())+2+IIf(Weekday(Date())>=2,7,0) And DateAdd("d",6,Date()-Weekday(Date())+2+IIf(Weekday(Date())>=2,7,0))
Bob
 
Thanks that worked for me. Any ideas on how to do the next part which is the same as before, but using the design query to show only the bookings of a particular Account Customer during the last four weeks. This will be the last time that I require your help.

Thanks if you can help.
 
Last edited:
To clarify, i need help on one more thing, i need the secnd query to do the same thing again, but to show only the bookings of a particular Account Customer during the last four weeks.

Thanks if anyone can help.
 
Hi -

Sorry for the delay (see below for details).

The simple answer is to enter a parameter (e.g. [Enter CustomerID]) as criteria for your CustomerID field.

What hung me up was attempting to include an Iif() statement which would allow you to either enter a CustomerID to see just those specific records, or enter "All" to return all records.

For some reason I still don't have it. There are a multitude of references in this forum and others, yet I can't seem to get the "All" side of the equation working.

Hopefully someone will see this post and provide some guidance.

Best Wishes - Bob
 
Well basically i need to do it as the first query, but to show only the bookings of a particular Account Customer during the last four weeks.

Can either yourself, or someone else help me? Just read through the topic and hopefully you can help. I also need an answer as quick as possible from anyone who can help me.

Thanks in advance.
 
Any help at all would be much appreciated, so please if anyone knows what to do, please click reply and reply!
 
You'll need something like
Code:
BookingDate BETWEEN Date() and (Date()-28)
in your WHERE clause.
 
You're not giving us much to work on, you know ;). What is the SQL statement that solved you first problem?
 
This one

Try copying/pasting this as the criteria for your date field:

Code:
Between Date()-Weekday(Date())+2+IIf(Weekday(Date())>=2,7,0) And DateAdd("d",6,Date()-Weekday(Date())+2+IIf(Weekday(Date())>=2,7,0))
Bob

that solved my first problem, but the second one needs to be the same as the first query, but to show only the bookings of a particular Account Customer during the last four weeks.
 
Oops, didn't read the thread well enough :D, I thought I needed to know the name of the date field.

Try copying/pasting this as the criteria for your date field:
Code:
Between (Date() and (Date()-28))
 
Hi -

My post (Post #4), lengthy as it is, will provide the following week. The hangup, which I poised, is to give the operator the option of either selecting 'All' appointments for the week, or selecting a specific customer.

Bob
 
Oops, didn't read the thread well enough :D, I thought I needed to know the name of the date field.

Try copying/pasting this as the criteria for your date field:
Code:
Between (Date() and (Date()-28))

This didnt work sorry, it says there is a missing operator before between or something like that, can you help again!
 
My bad.
Code:
Between Date() and (Date()-1)
 
Hello - What are we smoking here?

...need to show all dinner bookings for the coming week.

Not today and yesterday..
Code:
Between Date() and (Date()-1)

or the past 4 weeks..
Between Date() and (Date()-28)

Hope you get to feeling better.

Bob
 
Last edited:
\so can you quickly confirm what one i should use for the query to show the bookings for a particular account customer over the past four weeks?

Thanks.
 

Users who are viewing this thread

Back
Top Bottom