怎样主从表报表?(200分)

  • 主题发起人 hiyaolee
  • 开始时间
H

hiyaolee

Unregistered / Unconfirmed
GUEST, unregistred user!
有两个DB,怎样建立主从报表的格式化,
如:DB1 NO name age
db2 NO chinese math
要打印的格式是:
no name age chinese math
 
你会不会写SQL语句啊。
用一个 TQuery 把两个表关联,再出报表。
 
帮你把sql语句也写出来:
select a.no,a.name,a.age,b.chinese,b.math from db1 a,db2 b where a.no=b.no
 
能不能作一个具体的示例程序?
 
query1.close;
query1.sql.clear;
query1.sql.add('
select a.no,name,age,chinese,math from db1 a left join db2 b on a.no=b.no')
query1.open;
搞定
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
959
SUNSTONE的Delphi笔记
S
S
回复
0
查看
779
SUNSTONE的Delphi笔记
S
顶部