473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Finding sequences in a query‏

1
I'm am making a small programm for seat reservations. But I have a problem to find the sequence in the available seats. I will explain it with the following sample:
Expand|Select|Wrap|Line Numbers
  1. Row / Seat / Total Seats In Sequence / Sequence number / Available
  2. 1   /  1   /              3          /        1        /     3
  3. 1   /  2   /              3          /        2        /     2
  4. 1   /  3   /              3          /        3        /     1
  5. 1   /  6   /              4          /        1        /     4
  6. 1   /  7   /              4          /        2        /     3
  7. 1   /  8   /              4          /        3        /     2
  8. 1   /  9   /              4          /        4        /     1
  9. 2   /  1   /              3          /        1        /     3
  10. 2   /  2   /              3          /        2        /     2
  11. 2   /  3   /              3          /        3        /     1
  12. 2   /  8   /              2          /        1        /     2
  13. 2   /  9   /              2          /        2        /     1
If have tried to do it with Dcount but this function is very slow. The output of available seats is the row that I use for the rest of the database.

Please let me know if you have a better solution to get the availeble seats next to each other as an output.

For example if I need 3 seats the system have to give me to following options:
Expand|Select|Wrap|Line Numbers
  1. Row / Seat / Total Seats In Sequence / Sequence number / Available
  2. 1   /  1   /           3             /        1        /     3
  3. 1   /  6   /           4             /        1        /     4
  4. 1   /  7   /           4             /        2        /     3
  5. 2   /  1   /           3             /        1        /     3
Hope that you can help me, maybe Ecount works better but I can't figure out I can make it work for my query.

Best regards
Bart
Feb 11 '09 #1
2 1468
FishVal
2,653 Expert 2GB
Hello, Bart.

Frankly speaking I don't understand the meaning of 3 last fields.
However, to determine contiguous seat groups you need only Row, Seat, Reserved/Available fields. The rest is redundant.

Is that the case or the fields have some special meaning?

Regards,
Fish.
Feb 11 '09 #2
ADezii
8,834 Expert 8TB
I do agree with FishVal concerning the redundancy, but in any event, here is the SQL. Better yet, download the Attachment.
Expand|Select|Wrap|Line Numbers
  1. PARAMETERS [Enter Minimum Number of Seats Needed] Long;
  2. SELECT tblSeatReservations.Row, tblSeatReservations.Seat, tblSeatReservations.[Total Seats in Sequence], tblSeatReservations.[Sequence Number], tblSeatReservations.Available
  3. FROM tblSeatReservations
  4. WHERE (((tblSeatReservations.Available)>=[Enter Minimum Number of Seats Needed]));
Feb 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dom | last post by:
Hi, I have a werid problem with a subreport. If someone can help me out I'd be very grateful! Based on results from a query, the visibility of textboxes and labels in a subreport are set to...
11
by: Quackker12 | last post by:
I have Turbo C 2.0, and in layer3.c, a variable called mantisa is defined as: unsigned long mantisa: 27; The compiler says that the bit width is too large. How do I fix the code so I can...
3
by: pealy2 | last post by:
Sorry if this is in the wrong group, I've searched long & hard without finding anything even slightly useful. (recommendations for a more relevant group gratefuly received) I need to change the...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.