Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sp return X times 2
Message
From
04/05/1999 15:05:26
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Sp return X times 2
Miscellaneous
Thread ID:
00215097
Message ID:
00215097
Views:
74
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
Next
Reply
Map
View

Click here to load this message in the networking platform