Count Query

PeterKegels

New member
Local time
Today, 05:01
Joined
Apr 19, 2013
Messages
9
How to make a query where de first value is 0, the next line 1, the next line 2, ...?
 
What is the point of that? What problem does it solve?
 
If someone book a room at my hotel for several days, then i need a table whit te specific data.
For example:
Client a book a room from 16/05/2013 till 19/05/2013, then i need a table whit following information:
Room 13 Day 16/05/2013
Room 13 Day 17/05/2013
Room 13 Day 18/05/2013
Room 13 Day 19/05/2013

A query thats counting can solve this problem.

Now i have in my table only the startdate.
 
You don't need data for each day they are there, like you don't need data for each hour they are there, nor do you need data for each dollar they spend. You just need the totals.

So you need the start date and end date, and the total bill, but you don't need to store each data point in between.

See what I mean?
 
If someone is booking a room form 01/05/2013 till 16/05/2013 then i realy need a query where a can see all the dates between 01/05/2013 and 16/05/2013. If y see only the start and enddate then it is very possible that we will book the same room for excample from 06/05/2013 till 08/05/2013. If i store all the dates between start and end date i have the possibility to give a error if that room is booked already.
 
If i book only start and enddate, but there is a query where i casee all the dates between, then problem solved.
Room 12 06/05/2013
Room 12 07/05/2013
Room 12 08/05/2013
 
Here's a link that shows you how you don't need to keep track of every intermediate data point...
http://www.baldyweb.com/OverLap.htm
So if you know the start and end of one date range, and the start and end of another, you can calculate if they overlap.
Cheers,
 

Users who are viewing this thread

Back
Top Bottom