I have a sp called from VFP that is supposed to return the next voucher number and next check number from 2 different tables in our accounting system.
I use identical methods for accessing both tables. The problem I'm having is that while the voucher incrementing works perfectly, the check number is returning every other number. The section for checks is as follows:
/* Get Checkbook Account from Checkbook master file */
UPDATE checkfile
SET @cCheckNo = nxtchnum, @nCheckBkActId = actindx,
nxtchnum = LTRIM(STR(CONVERT(int, nxtchnum) + 1))
WHERE chekbkid = @cCheckBkId
The really odd thing is that if I rearrange the code to have the increment as the 1st part of the set, the next time I run the code it will increment by 1. The 2nd time it will increment by 2 again.
Any help appreciated,
PF
(On an infant's shirt): Already smarter than Bush