473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parsing of Dates

yk
I am setting up a simple hotel reservation application which have two dates,
i.e. CheckIn and CheckOut. I would like to construct a graph based on a
crosstab query. Therefore, I need to have columns for each date between
CheckIn and CheckOut and the numeric 1 in the field. I have tried but not
successfull. Anyone can help me out? TQ.
Apr 3 '06 #1
1 2020
"yk" <oy*****@gmail.com> schreef in bericht
news:44**********@news.tm.net.my...
I am setting up a simple hotel reservation application which have two
dates, i.e. CheckIn and CheckOut. I would like to construct a graph based
on a crosstab query. Therefore, I need to have columns for each date
between CheckIn and CheckOut and the numeric 1 in the field. I have tried
but not successfull. Anyone can help me out? TQ.


Tricky, but possible. I did the same in a reservations-database for a
campsite generating a report to show bookings in a certain month (days
horizontal, fields vertical, bookings as the value) and to show all bookings
(fields horizontal and dates vertical continuing on the next pages)

First: create a table / query with all possible dates you would like in your
output. This is possible by creating a table with numbers from 1 to the
largest possible booking-length you can imagine (+ some extra). Call this
"Days".

Let's assume you have a maximum stay of 5 days, so table Days contains five
rows with values 1, 2, 3, 4 and 5.
Let's further assume you have 1 booking with BookingID = 10, CheckIn =
4-3-2006 and Checkout = 6-3-2006

Second: After that, query your table with reservations and 'days' WITHOUT
joining them. This trick is important.
Query both tables without join would result in all possible combinations,
output fields [BookingID] and [CheckIn]+[Day] results in:
10, 4-3-2006
10, 5-3-2006
10, 6-3-2006
10, 7-3-2006
10, 8-3-2006

Add a criterium om column [CheckIn] + [Day] <= [CheckOut]

This results in
10, 4-3-2006
10, 5-3-2006
10, 6-3-2006

Third: continue to do whatever you want. For instance: query the above
result in combination with RoomNumber by joining this with [Bookings] on
[BookingID] = [BookingID]. Make this your cross-tab query with the room
numbers as column headers and the dates as row headers. Show
Count(BookingID) as the value, and if you see a value larger than 2, you'd
have found a doubly-booked room. Or join this with the table Customers and
show first([Firstname] & " " & [LastName]) as the value to get a cross tab
overview of all customers for each room and for each date.

Experiment with left-joins to get all rooms included, thus also showing the
rooms that are vacant.

Continue to make it fancy with the cross-tab report wizard and work the code
to show occupied rooms in yellow background. Endless possibilities.

Bas Hartkamp.


Apr 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
9422
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
1
1474
by: Daniel M. Drucker | last post by:
Is there any way to parse tar-style dates like "tomorrow" or "next wednesday" in python, other than doing a system call to date --date="string" and then parsing its output? Daniel Drucker...
9
2743
by: Thomas W | last post by:
I'm developing a web-application where the user sometimes has to enter dates in plain text, allthough a format may be provided to give clues. On the server side this piece of text has to be parsed...
6
4308
by: Tim N. van der Leeuw | last post by:
Hi, I want to parse strings containing date-time, which look like the following: "Mon Dec 19 11:06:12:333 CET 2005" That's a problem for strptime it seems, b/c I cannot find any...
0
1126
by: Uncle Leo | last post by:
I created an OleDbDataAdapter with the wizard in Visual Studio 2003. It created a dataset, connectionstring etc. for me to work with. It also created a .xsd file where one of the columns type is...
5
2322
by: moddster | last post by:
Hi Guys. I am a newbie to perl and need some help with a problem. PROBLEM: I have to parse an HTML file and get rid of all the HTML tags and count the number of sumbissions a person has through...
6
4409
by: rellaboyina | last post by:
Dear All, I am having some data which will be stored in XML format and this needs to be parsed using the parser module XML::Parser and XML::Parser::Expat. This data consists of some special...
1
2318
by: Malcolm Greene | last post by:
The locale module provides the ability to format dates, currency and numbers according to a specific locale. Is there a corresponding module for parsing locale's output to convert locale...
0
1165
by: taa | last post by:
Hi there I’m trying to come up with a smart way of parsing content from textboxes in C#. I have about 7-10 boxes with different content; dates, times, numbers and text that has to be parsed and...
0
6912
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
7092
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...
1
6744
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
5348
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,...
1
4790
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...
0
3000
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.