Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering a day, to enter in data for a specific week

Status
Not open for further replies.
Feb 20, 2001
24
US
Hi, I have to create an application where a date is entered and based on that date, the user is brought to a form where they can enter in information for a certain WEEK. So any date entered in which is within the same week will bring up the same form. There will be only one field of data per program per week. The problem is that the week needs to be defined from Friday to Thursday instead of the usual Sunday to Saturday. So for example if someone entered data in on this Thursday, May 2, and then attempted to enter in data for Friday, May 3, they would be entering data into two different data fields for two different weeks. However if they entered in data for Wednesday and Thursday, they would be entering data into the same field. So I guess my question is, has anybody had to do something like this before? Is there any relatively simple way to set something like this, any specific functions I should use. I have a few half ideas on how to possibly set this up but nothing really firm. If I'm not explaining this clearly enough or you have any questions please let me know. Any hints or pointers would be greatly appreciated.
 


I think the Weekday or Date part functions could be of benefit here
These functions returns a variant stating what day of the week it is.


Weekday(date, [firstdayofweek])

firstdayofweek Optional. A constant that specifies the first day of the week. If not specified, vbSunday is assumed.


Settings

The firstdayofweek argument has these settings:

Constant Value Description
vbUseSystem 0 Use the NLS API setting.
vbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

Weekday(date, 6)

Would ensure the week started in the correct place and you could use the DatePart function to check the Week as a whole


DatePart(ww, date[,firstdayofweek[, firstweekofyear]])

ww = week
firstdayofweek Optional.

firstweekofyear Optional.

I hope this may be of use

regards

Jo
 
Hi,
Thanks for the suggestions. I was able to use those functions and work up a solution. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top