PDA

View Full Version : generate a number from data base ..


kalosneri
06-02-2005, 10:56 AM
hi!..

i want to generate a "receipt" number while the "receipt" number in data base is null..
when i call the data in data base the "receipt" number will generate it self..
exmple..

receipt=num_receipt+1
num_receipt=receipt

<input type="text" name="receipt" value="<%=receipt%>" >


whet i run the program the "receipt" number will generate but only if in the data base not null.and always replace the same data in data base.
what condition should i use to make it generate its self and ?

miranda
06-02-2005, 08:14 PM
UPDATE myTable SET receipt = 1 WHERE ((IsNull(receipt))=True);

will update all rows that had null value for receipt to 1