Hi.. does anyone see anything obvious here?
I am trying to write a unique random number that ends with the date, so it just goes down the item code column of a table . The one problem, it writes just one code for the first record in the table and then stops.
Am I missing something obvious? Its been a long day....
Thanks,
Chris
I am trying to write a unique random number that ends with the date, so it just goes down the item code column of a table . The one problem, it writes just one code for the first record in the table and then stops.
Code:
INSERT INTO [tablename] ( [itemcode] )
SELECT Chr(Int((90-65+1)*Rnd()+65)) & Chr(Int((90-65+1)*Rnd()+65)) & CStr((Int((9-0+1)*Rnd()+0))) & "-" & Chr(Int((90-65+1)*Rnd()+65)) & Chr(Int((90-65+1)*Rnd()+65)) & CStr((Int((9-0+1)*Rnd()+0))) & "-" & CStr(Format(Date(),'yyyymmdd')) AS Expr1;
Am I missing something obvious? Its been a long day....
Thanks,
Chris