malice
September 29th, 2005, 04:40 PM
First of all apologies if this is in the wrong forum!
I am developing an Access datebase which communicates with an ASP script. It is basically a booking system. The user makes a booking on a particular day and what I am having trouble doing is generating date for bookings made on particular days of the week e.g. Monday Bookings, Tuesday Bookings etc.
I am using the DatePart function to return a number corresponding to the day of the week that the booking was made. I want the booking week to run from Monday to Sunday. The MSDN help on DatePart() tells me that to do this I need to pass a 2 as a function parameter.
The syntax is as follows:
.........
recDate = recordSet("bkDate").Value
' 2 => first day of week = monday
dayOfWeek = DatePart("w", recDate, 2)
.........
dayOfWeek should now contain a number from 1 to 7 telling me the day of the week but what I actually get is a number from 1 to 6 (Monday to Saturday). In other words, Sunday doesn't appear!!
I'm wondering if this is supposed to be the case and if so, how do I get ASP to give me a week from Monday to Sunday?
I am developing an Access datebase which communicates with an ASP script. It is basically a booking system. The user makes a booking on a particular day and what I am having trouble doing is generating date for bookings made on particular days of the week e.g. Monday Bookings, Tuesday Bookings etc.
I am using the DatePart function to return a number corresponding to the day of the week that the booking was made. I want the booking week to run from Monday to Sunday. The MSDN help on DatePart() tells me that to do this I need to pass a 2 as a function parameter.
The syntax is as follows:
.........
recDate = recordSet("bkDate").Value
' 2 => first day of week = monday
dayOfWeek = DatePart("w", recDate, 2)
.........
dayOfWeek should now contain a number from 1 to 7 telling me the day of the week but what I actually get is a number from 1 to 6 (Monday to Saturday). In other words, Sunday doesn't appear!!
I'm wondering if this is supposed to be the case and if so, how do I get ASP to give me a week from Monday to Sunday?