PC Review


Reply
Thread Tools Rate Thread

How do I display week numbers when the week runs Saturday to Frida

 
 
milly54
Guest
Posts: n/a
 
      14th Aug 2008
Hi,
I'm working with a holiday-park database, where the booking week runs from
Saturday to Friday - (and may also have midweek bookings traversing a
weekend).

I'm trying to report their bookings/values by week number, but as the ISO
week is Monday to Sunday, I get incorrect/split reporting.

The week numbering does NOT have to agree with calendar week numbers, just a
numerical value incrementing through the booking year (eg from Sat 5th Jan
2000 to Fri 26th Dec 2008)

I've tried using: DatePart("ww",[Booking_Start],7) but of course this is
only good if the booking starts on a Saturday.

Is there a way to achieve this?

Many thanks


 
Reply With Quote
 
 
 
 
Klatuu
Guest
Posts: n/a
 
      14th Aug 2008
Well, for starters, Jan 5, 2000 was on a Wednesday. Jan 5, 2008 is a Saturday.
You don't define your rules very well, so an answer is a bit difficult. For
example, assuming you meant Week 1 should start on 1/5/2008, the your
expression should be:
datepart("ww",#1/5/2008#,vbSaturday,vbFirstFullWeek)

That would mean that 1/1 through 1/4 would return 52, being in the previous
year.
Any other option wouls return 2.

> I've tried using: DatePart("ww",[Booking_Start],7) but of course this is
> only good if the booking starts on a Saturday.


Not really. It depends on how you define which week a booking belongs to.
It is not possible a booking could cross a week boundry? for example, a
booking from

8/8/2008 through 8/14/2008 (using the expression above) would start in week
32 and end in week 33. That is a friday to friday booking. But even if a
booking starts on a saturday, it could still run over a week boundry, so the
issue is to determine the business rule on which week the booking belongs to.


--
Dave Hargis, Microsoft Access MVP


"milly54" wrote:

> Hi,
> I'm working with a holiday-park database, where the booking week runs from
> Saturday to Friday - (and may also have midweek bookings traversing a
> weekend).
>
> I'm trying to report their bookings/values by week number, but as the ISO
> week is Monday to Sunday, I get incorrect/split reporting.
>
> The week numbering does NOT have to agree with calendar week numbers, just a
> numerical value incrementing through the booking year (eg from Sat 5th Jan
> 2000 to Fri 26th Dec 2008)
>
> I've tried using: DatePart("ww",[Booking_Start],7) but of course this is
> only good if the booking starts on a Saturday.
>
> Is there a way to achieve this?
>
> Many thanks
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display and store current Week Ending Date (Saturday's) ianw Microsoft Access Getting Started 2 17th May 2009 04:13 PM
How to display and store current Week Ending Date (Saturday's) ianw Microsoft Access Getting Started 0 17th May 2009 03:55 PM
How do I display week numbers in calendar? =?Utf-8?B?VGFraWRlZXp5?= Microsoft Outlook Calendar 2 22nd Feb 2006 04:11 PM
Re: how do I show Week numbers in outlook calendar, example week 1 (0. Milly Staples [MVP - Outlook] Microsoft Outlook Calendar 4 6th Sep 2004 03:22 AM
How display week numbers in calendar? Danilo Copiz Microsoft Outlook Calendar 3 18th Sep 2003 01:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.