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!

Calculate current Pay Period on form

Status
Not open for further replies.
May 5, 2000
168
US
On my form there is a "Pay Period" field. I want to look up the current pay period from a sql table "PayrollCalendar"

When the form opens I want to populate the text field "PayPeriod" on the form with the current pay period using the StartDate and EndDate from the table. It can either be concantenated or I can create two text fields for startdate and enddate. I also want to capture the current PayPeriod field in the table. Pay periods are bi-weekly and always end on Sunday, and the new pay period starts the next day (Monday).

Here is the table structure

PayPeriod StartDate EndDate
07-23 4/22/2007 5/5/2007
07-24 5/6/2007 5/19/2007
07-25 5/20/2007 6/2/2007
07-26 6/3/2007 6/16/2007
08-01 6/17/2007 6/30/2007
08-02 7/1/2007 7/14/2007
08-03 7/15/2007 7/28/2007
08-04 7/29/2007 8/11/2007
08-05 8/12/2007 8/25/2007
08-06 8/26/2007 9/8/2007
08-07 9/9/2007 9/22/2007




 
This doesn't sound like a JavaScript question.

What type of database are you using? If you need help creating a query to get the pay period, you should ask for help in one of the database forums.

What type of server-side technology are you using to output the database values to the page? ASP.NET, PHP, other? If you need help outputting the value to the page, you should ask for help in the forum for whatever technology you are using.

Adam
 
This is a form based on javascript.

I will use a select statement to pull the data from a database.
 
What you are wanting is server side code. ASP, ASP.NET, PHP are examples of server side code that will do what you are asking.

Javascript is client side code, it cannot populate any fields with data pulled from a database, not directly.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top