473,398 Members | 2,335 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,398 software developers and data experts.

I don't know how to start !

Dear All,

I don't know how to start !

I have a table named COMPANY_HOLIDAY having fields: COMH_ID,
COMH_HOL_FROM_DATE and COMH_HOL_TO_DATE

ID FROM_DATE TO_DATE
1 13/12/2006 14/12/2006
2 12/12/2006 12/12/2006
2 21/12/2006 22/12/2006
3 1/12/2006 21/12/2006

Must build a form having:
COLUMNS: CompanyName + the days of selected month/year ( February 2007) like
ROWS: companies ( all or a selection)

Microsoft feb1 feb2 feb3 feb4 >>feb28
ABC-news feb1 feb2 feb3 feb4 >>feb28
Flash-TV feb1 feb2 feb3 feb4 >>feb28

(Working days in white-color, weekend-days in gray and holidays in red.)

I think I need a recordset ( table, query) for the form's Recordsource !

Thanks,

Filip

Dec 16 '06 #1
1 1222
You will need a table of dates, so you can create a query that has a record
for each date in the date range. You can the create a crosstab query to show
the dates in the format you want. Note that the form will be read-only, i.e.
you will not be able to enter anything in that form (unless you handle the
entries programmatically.)

1. Create a table of dates.
Just one date/time field named (say) TheDate, and marked as primary key.
Save the table with the name tblDate.

2. Create the query using both tables (your existing table, and tblDate.)
There must be no line joining the 2 tables in the upper pane of query
design.
In the Criteria under tblDate.TheDate, enter:
Between COMPANY_HOLIDAY.FROM_DATE And COMPANY_HOLIDAY.TO_DATE
This gives you are record for every date in the date range.
The query in SQL View (View menu) will look something like this.

SELECT COMPANY_HOLIDAY.COMH_ID,
COMPANY_HOLIDAY.FROM_DATE,
COMPANY_HOLIDAY.TO_DATE
tblDate.TheDate
FROM COMPANY_HOLIDAY, tblDate
WHERE tblDate.TheDate Between COMPANY_HOLIDAY.FROM_DATE And
COMPANY_HOLIDAY.TO_DATE

3. Add your Company table to the query.
I'm assuming that COMH_ID is the field that indicates which company has this
booking? And that you want to show the company name in the query instead of
the COMH_ID? So add the company table to the query. Add the Compnay name to
the output grid.

4. Save that query with a name such as Query1. Close.

5. Create a new query, using Query1 as an input "table".
In query design view, change it to a Crosstab query (Crosstab on Query
menu.)
Access adds 2 rows to the design grid: Total, and Crosstab.

6. Enter these fields as columns in query design.
(The 3 rows refer to the Field, Group By, and Crosstab rows respectively.)

- Company
Group By
Row Header

- TheYear: Year(TheDate)
Group By
Row Header

- TheMonth: Month(TheDate)
Group By
RowHeader

- TheDay:Day(TheDate)
Group By
Column Header

- ComH_ID
First
Value

That gives you the basis to build a form or report. You probably want to
enter the numbers 1 to 31 (separated by commas) in the query's Column
Headings property, to guarantee that all days show.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Filips Benoit" <be***********@pandora.bewrote in message
news:4W**********************@phobos.telenet-ops.be...
Dear All,

I don't know how to start !

I have a table named COMPANY_HOLIDAY having fields: COMH_ID,
COMH_HOL_FROM_DATE and COMH_HOL_TO_DATE

ID FROM_DATE TO_DATE
1 13/12/2006 14/12/2006
2 12/12/2006 12/12/2006
2 21/12/2006 22/12/2006
3 1/12/2006 21/12/2006

Must build a form having:
COLUMNS: CompanyName + the days of selected month/year ( February 2007)
like
ROWS: companies ( all or a selection)

Microsoft feb1 feb2 feb3 feb4 >>feb28
ABC-news feb1 feb2 feb3 feb4 >>feb28
Flash-TV feb1 feb2 feb3 feb4 >>feb28

(Working days in white-color, weekend-days in gray and holidays in red.)

I think I need a recordset ( table, query) for the form's Recordsource !

Thanks,

Filip

Dec 16 '06 #2

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

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
18
by: tomakated | last post by:
Hi, i'm new here and I can't get my get_item_price() function to work I need it to take in 4 items int main() { double item1, item2, item3, item4, lowest=0, total; char response;
15
by: Paul T. RONG | last post by:
Hello, I am making a restaurant database (it is much more complicated than I thought before!), now it comes to the last stage and I come across a problem. I will explain it in detail. In a...
2
by: David | last post by:
SUMMARY: If you don't want to read all of this, what I'm looking for more or less is ideas on how to implement websites using ASP.NET that have a templated look and feel and many pages that make...
3
by: fedderico10 | last post by:
Heloo everybody!! Hope someone can help me because im new to C++ Im trying to write a program in c++. This must run and keep waiting until i type one number (0-9) and then run some functions i've...
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
6
by: webandwe | last post by:
Hi, My script lets you choose if you want to view table 1 or table 2 in mysql after you selected 1 or 2 from the drop down menu and press submit. The problem is if you run the script for the...
3
by: =?Utf-8?B?UmF5?= | last post by:
Hello. I have a c# service with four threads. Sometimes one of them just don't start, I don't know why. It happened with any of the four threads, and just in production environment, not in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.