 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stark Guest
|
Posted: Sun Jan 23, 2005 2:19 pm Post subject: How to set a field value to another filed value |
|
|
I want to set the field BUDGET_AMOUNT to the value held by a second field
AMOUNT_01 or AMOUNT_02, etc
but I can't figure out how to do it using parameters. I tried the following:
UPDATE MYBUDGET SET BUDGET_AMOUNT=:dBudget';
Leaving alone for the moment thew question of setting up the correct field
name, suppose I want to copy the AMOUNT_01 value to the BUDGET_AMOUNT
value.I tried setting the dBudget parameter with the following statement:
ParamByName('dBudget').AsFloat := FieldByName('AMOUNT_01').AsFloat;
I get an error message "..Query1: Field AMOUNT_01 not found"
Is there a way to do what I am trying using local SQL ? Thanks for any
anwer.
|
|
| Back to top |
|
 |
Augustose@gmail.com Guest
|
Posted: Tue Jan 25, 2005 2:15 pm Post subject: Re: How to set a field value to another filed value |
|
|
Are both fields in te same table ?
Query1.ParamByName('dBudget').AsFloat :=
Query2.FieldByName('AMOUNT_01').AsFloat;
This is posible, but not if we are talking of the same query.
one query can contain a select OR an update instruction at time.
Best Regards
Augusto
|
|
| Back to top |
|
 |
Stark Guest
|
Posted: Tue Jan 25, 2005 3:05 pm Post subject: Re: How to set a field value to another filed value |
|
|
Finally, I got back to Internet.
Yes, both fields are on the same table. Is there another way to do what I
need, which is simply to copy the content of one filed onto another field ?
<Augustose (AT) gmail (DOT) com> ha scritto nel messaggio
news:1106662513.483602.142180 (AT) z14g2000cwz (DOT) googlegroups.com...
| Quote: | Are both fields in te same table ?
Query1.ParamByName('dBudget').AsFloat :=
Query2.FieldByName('AMOUNT_01').AsFloat;
This is posible, but not if we are talking of the same query.
one query can contain a select OR an update instruction at time.
Best Regards
Augusto
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|