...

View Full Version : asp query



cloudy
05-23-2007, 10:44 AM
hi..i need some help on wat the code i write as below.
i m newbie in asp, so quite poor in the concept.

COLOR="Navy"]
Let say I have 2 type of leave type(annual leave and medical leave), then i set 2 type of balance leave in the DB (bannualleave,bmedicalleave)
this two type of leave have thier own balance.wat i wan to do is...::
*************************
if leavetypeid="annual leave” then
Balance=rsleave("BAnnualleave")
NewBalance=Balance-totalday 'Totalday is the total leave emp apply

elseif leavetypeid="medical leave" then
Medical=rs("BMedicalLeave")
NewMedicalBalance=Medical-totalday
Else
…..
end if[/COLOR]

after this if else statement, how can i update the column for bannualleave and bmedicalleave.i wan to do is if the leave type is annual leave then update the bannualleave in the table else if the leave type is medical leave then update the bmedicalleave in the table.do i need to write 2 query or got any other better solution?

strupdate="UPDATE leaverecord Set BAnnualleave='"&NewBalance&"' WHERE empid=" &empid


i hope can get form you all soon.i need to solve this problem ...:(
thank you.

Spudhead
05-23-2007, 12:09 PM
run the update INSIDE the if/else?

cloudy
05-30-2007, 03:04 AM
hi Spudhead , thank you for ur kind response.
i have solve this problem.
again, thank you very much.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum