View Full Version : asp query

05-23-2007, 09: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.

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
NewBalance=Balance-totalday 'Totalday is the total leave emp apply

elseif leavetypeid="medical leave" then
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.

05-23-2007, 11:09 AM
run the update INSIDE the if/else?

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