Autotext

bberrelez

New member
Local time
Yesterday, 22:55
Joined
Jan 30, 2008
Messages
5
I was wondering if anyone had any information they could point me to that will show me how to automatically assign a value to a certain field.

I already have a primary key. I added a new field and I was wondering how I could go about adding a specific value multiple times. For instance.

Charge_Line Freight_ID
1 Fr01
2 Fr02

So I would like to assign Fr01 to charge line one and Fr02 to charge line 2. I could do this manually but I have a huge amount of entries, furthermore I plan on doing this to future records.

Is this possible to do this in SQL statement?

Any help would be great. Thank you!
 
You could use an update query.
Code:
update table set Freight_ID = "Fr" & format(charge_line, "0#") where Freight_ID is null
HTH:D
 
Charge_Line Freight_ID
1 Fr01
2 Fr02

So I would like to assign Fr01 to charge line one and Fr02 to charge line 2. I could do this manually but I have a huge amount of entries. Is this possible to do this in SQL statement?
No. Not from what I gather you want to do here. SQL doesn't really manipulate data inside of it's own table (in terms of record additions and such).
furthermore I plan on doing this to future records.
If you're going to want to carry these values forward with new records, and just take on the next sequential number at the end of the value, you could use a function like DMAX() or something to get the largest value in the appropriate field.
 

Users who are viewing this thread

Back
Top Bottom