BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to set a field value to another filed value

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Stark
Guest





PostPosted: Sun Jan 23, 2005 2:19 pm    Post subject: How to set a field value to another filed value Reply with quote



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





PostPosted: Tue Jan 25, 2005 2:15 pm    Post subject: Re: How to set a field value to another filed value Reply with 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
Stark
Guest





PostPosted: Tue Jan 25, 2005 3:05 pm    Post subject: Re: How to set a field value to another filed value Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.