Dates Available??

K

KAnoe

I need help with setting up date tracking. I have a start date and End date.
I would like to show that dates as booked. So if the start date is 1 Nov and
End date is 7 Nov the room would show in a crosstab
1 Nov 2 Nov 3 Nov 4 Nov 5 Nov 6 Nov 7 Nov
Rm 1 X X X X X X X
Rm 2 X X

Also Could I do a Query that I could use to look up room availability?

Any Help would be great!
 
D

Duane Hookom

The solution depends on your table structure. Do you intend to display the
results in a report?
 
K

KAnoe

I would like to use both a Report and a Qurey. I would us the query as need
to lookup open rooms.

Thanks
 
D

Duane Hookom

Here is a FAQ from tektips.com Access Reports forum. You should be able to
"repurpose" this for dates rather than months. I would make the report
contain a specific number of columns/dates.

Try not to use "absolute" column headings for dates. You could possibly use
"relative" dates. For instance:
Form: frmA
Text Box: txtEndDate
Table: tblSales
Field: SaleDate
You want to show 12 months of sales in columns of a crosstab report.
Set the with menuing: Query|Parameter
Forms!frmA!txtEndDate Date/Time

Use this expression for your Column Headings:
ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txtEndDate)

This will produce Mth0, Mth1, Mth2, Mth3,... where Mth0 is sales from the
same month as the ending date on your form. Mth1 is the previous month etc.

Set your queries Column Headings property to:
"Mth0", "Mth1", "Mth2", "Mth3",.., "Mth11"
Build your report based on these "relative" months. If you need column
labels in your report, use text boxes with control sources of:
=DateAdd("m",0,Forms!frmA!txtEndDate)
=DateAdd("m",-1,Forms!frmA!txtEndDate)
=DateAdd("m",-2,Forms!frmA!txtEndDate)
=DateAdd("m",-3,Forms!frmA!txtEndDate)
...
This solution requires no code and will run fairly quickly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top