Automatically Populate a week ending field

C

Chris Chandler

I am not sure how to do this. I have been setting up a Data access Page to
update payroll hours. This is only done once every two weeks for the Pay
period ending xx/xx/xxx.
How would I set this up so that the week ending date automatically populates
the Week Ending field, then if they need to review hours, they can select the
Week Ending Date and it would show them the hours input for that period?

This is connecting to a SQL database where each store has its own table.
Should there be a separate DB for each store? I figure I am probably setting
this up worng or something. Right now it is just s sandbox so if I have to
delete it and start over it is't a big deal.
 
D

DevalilaJohn

You have two questions, largely unrelated, so I'll try and answer each.

You can use the Weekday function to calculate the week ending date. If you
use intDays = Weekday(Date)

you will get the day number for the current date. Without changing the week
start day that would give you a 6 (today being Friday). I'll leave it up to
you to determine the right context to utilize. I'm assuming that when
someone is entering hours, they have to indicate what day the hours are for,
so you can figure the week ending from there.

As to the correct structure of your database, you need to determine how much
data will be involved, how much and what type of usage, how the database(s)
will be accessed, etc., etc. There is no one right answer here as there are
too many variables involved.

Sorry I can't be more specific on the second point.
 
C

Chris Chandler

You have two questions, largely unrelated, so I'll try and answer each.

You can use the Weekday function to calculate the week ending date. If
you use intDays = Weekday(Date)

you will get the day number for the current date. Without changing the
week start day that would give you a 6 (today being Friday). I'll leave
it up to you to determine the right context to utilize. I'm assuming
that when someone is entering hours, they have to indicate what day the
hours are for, so you can figure the week ending from there.

Actually I think what I am looking for is some sort of combo box control.
Hours are entered on a bi-weekly basis. For instannce, if the Pay period
ends on Sunday 10/24/2004 then the next pay period that hours would need to
be entered would be 11/07/2004 and so on. They are not entered in on a
daily basis, the system in the store runs a report based on teh 2 week
total. say a Manager worked 40 hours then when it is time to enter in teh
hours for payroll, they would select the persons name, and enter in 80 for
both weeks. I would liek to igure out how to let them be able to go back
and say check a pay period prior to this to see how many hours they entere
in for a said person. I hope that is a little clearer
 
Top