Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL SOS

Status
Not open for further replies.
Mar 9, 2006
4
GB
Hi, I have a bit of a quandry with a procedure request and was wondering if anyone out there could point me in the right direction:

I have a lookup table A and 2 updateable tables B and C

For every account in A that matches in table B i need to insert 2 records into table B in the following format

batchID(DDMMYY+seqNo) + 'AB' + ...
batchID(DDMMYY+seqNo+1) + 'BC' + .....

e.g

For Account 1000 the first account in the list.

batchID(08032006001) + 'AB' + ...
batchID(08032006002) + 'BC' + .....

the next account 1001

batchID(08032006003) + 'AB' + ...
batchID(08032006004) + 'BC' + .....

then the extra complication, in table C insert another formatted field

X + y + (ID = maximum(batchid)) per account no.

Hope this makes sense, any nuggets would be much appreciated.

Thanks in advance






where seqno starts 0001
 
Its hard to make out what the code does. Please explain the statements

Code:
batchID(DDMMYY+seqNo) + 'AB' + ...
batchID(DDMMYY+seqNo+1) + 'BC' + .....

in specific what is "'AB' + ...". Are A and B tables?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top