Forums

ASP

This topic is locked

hello

Posted 13 Apr 2006 05:06:24
1
has voted
13 Apr 2006 05:06:24 chong lu yen posted:
can someone help me reduce the leave days after a staff take leave?thanx....using ASP

Replies

Replied 13 Apr 2006 18:57:08
13 Apr 2006 18:57:08 micah santos replied:
can u please ellaborate this sequence?
Replied 14 Apr 2006 09:50:03
14 Apr 2006 09:50:03 chong lu yen replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
can u please ellaborate this sequence?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

hmm..i means..after the staff apply...the leave..then next time..tat staff apply again.it will display the balance of leave day that he have.how?thanx
Replied 14 Apr 2006 19:27:30
14 Apr 2006 19:27:30 micah santos replied:
&lt;%

// Variables

Dim leaveStart,leaveEnd,leaveTaken
Dim leaveBal,leave


// Assuming that your firm has the maximum leave a staff can take for (1) year

leave = 30
leaveBal = 0

leaveStart = "04/11/006"
leaveEnd = "05/15/2006"

leaveStart = cDate(leaveStart)
leaveEnd = cDate(leaveEnd)


// Computation

leaveTaken = DateDiff("d",leaveStart,leaveEnd)

leaveBal = (leave - leaveTaken)


// This one resulting to a negative value, which means that person exceeded the
// maximum leave day

// Display the record in a form
// e.g.

Response.write "Name: John Doe" & "&lt;br&gt;"
Response.write "Leave Days Available: " & leaveBal

%&gt;

Reply to this topic