Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Generating report through a single query

Author  Topic 

nssjari
Starting Member

46 Posts

Posted - 2005-06-22 : 07:40:52
I have 4 tables of few thousand records and I need to generate a query for a report that gives me my required fields ...
I know that does not explain my question but could u please mail me your id so that i can send you an attachment ... Coz here i dont see and facility to attach a file for more info.

Jari

Jari
Computer Engg

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-06-22 : 07:44:52
Post table structures with sample data and expected result

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

nssjari
Starting Member

46 Posts

Posted - 2005-06-22 : 08:05:19
Can u please help me in one of my query reports
SQLTeam on 6/22/2005 in The Topic
Neeraj writes "I have 4 tables of a legacy system and i need to generate a report with fields from these tables.
[Unique Fields]

CSD table
[csd_orig, csd_subj, csd_type, csd_numb, csd_revi,] csd_labl, csd_stage, csd_issu, csd_altr, csd_reqd, csd_ownr, csd_tdes, csd_aclas

TRA table
[tra_trno, tra_drgn,] tra_medi, tra_copy, tra_appr, tra_stag, [tra_part,] tra_type

TRD table
[trd_trno, trd_part,] trd_lock, trd_copy, trd_medi, trd_type, [trd_cc,] trd_recd, trd_dset

APR table
[apr_docu, apr_part,] apr_type, apr_trn2, apr_stat, apr_reqd

select
csd1.csd_altr, csd1.csd_labl, csd1.csd_issu,
csd2.csd_altr, csd2.csd_issu,
trd1.trd_recd,
apr1.apr_reqd, apr1.apr_trn2, apr1.apr_stat
from
e0362csd csd1,
e0362tra tra1,
e0362csd csd2,
e0362trd trd1,
e0362apr apr1
where
csd1.csd_orig = 'BS' and
csd1.csd_subj = 'MSUB' and
csd1.csd_type = 'M' and

tra1.tra_trno = csd2.csd_orig + csd2.csd_subj + csd2.csd_type + csd2.csd_numb + csd2.csd_revi and
tra1.tra_drgn = csd1.csd_orig + csd1.csd_subj + csd1.csd_type + csd1.csd_numb + csd1.csd_revi and
tra1.tra_part = 'NAKHE' and
tra1.tra_type = 'A' and

trd1.trd_trno = tra1.tra_trno and
trd1.trd_part = tra1.tra_part and
trd1.trd_cc = '0' and
trd1.trd_type = 'A' and

apr1.apr_docu = tra1.tra_drgn and
apr1.apr_part = tra1.tra_part and
apr1.apr_type = 'A'

order by
csd1.csd_orig + csd1.csd_subj + csd1.csd_type + csd1.csd_numb + csd1.csd_revi

I get a report with this ... but the way I need is a bit different ... I need your help asap ...please.

Here i dont see a link for attachment since u may not get the real problem ... that i am facing when the tables are populated with few thousand rows ... May i send you an attachemnt of few things ... how and where... on what id URGENT PLEASE."


Jari
Computer Engg
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-06-22 : 08:21:45
No need to post all data. Post some sample data with your expected result

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -