Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB Tools

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2009, 02:43 PM
Javad_zahmatkesh Javad_zahmatkesh is offline
Senior Member
 
Join Date: May 2003
Posts: 160
Default RecordSet

hi
i have 3 TadoQuery
i want to combine Adoquery2 And Adoqeury3 Recordset and append to Tadoquery1 Recordset
how can i do that?
Reply With Quote
  #2  
Old 10-19-2010, 03:48 AM
ixilimuse ixilimuse is offline
Junior Member
 
Join Date: Oct 2010
Location: Near Russia
Posts: 2
Send a message via ICQ to ixilimuse Send a message via Skype™ to ixilimuse
Default

Hi,
You can use this:

Code:
q1.FieldByName('SomeName').asString := q2.FieldByName('SomeName').asString + ' ' + q3.FieldByName('SomeName').asString;
But this will only work with strings. Numeric fields will be summarized.

You can use "Q.Fields.tag", to determine the string fields. And move the field in the loop by assigning a string.

Something like:
Code:
...
 
If q1.Fields[I].tag = 1 then 
begin
 q1.Append;
 q1.Fields[I].AsString := q2.Fields[I].AsString + ' ' + q3.Fields[I].AsString;
 q1.Post;
end;
q2.Next;
q3.Next;
...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.