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
 General SQL Server Forums
 New to SQL Server Programming
 SELECT statement

Author  Topic 

arthemyth
Starting Member

2 Posts

Posted - 2011-09-07 : 09:17:03
[sql]select distinct client_cd &client_cd1
a.client_name || a.client_name_ext &clt_name1
a.cds_acct_num &cds_acct_num1
rtrim(ltrim(a.def_addr_1)) &clt_addr11
rtrim(ltrim(a.def_addr_2)) &clt_addr21
rtrim(ltrim(a.def_addr_3)) &clt_addr31
a.post_cd &post_cd1
a.staff_cd &staff_cd1
substr(d.staff_name_abbr,1,19) &cl_staff_name1

do 1_print_letter_head
position (+2)
let #rec = 1
do l_get_data1
do 1_print_letter_tail

from comh_client a, comh_staff d
where a.staff_cd = d.staff_cd and d.staff_cd <> 'ZZZ' and rtrim(a.client_cd) = 'ABU'
order by client_cd
[/sql]

[sql]select distinct a.div_amt_alloc &amt_paid1
b.payment_dt &pay_dt1
substr(c.stk_desc,1,38) &stk_name1



if #rec > 10
do 1_print_letter_tail
do 1_print_letter_head
let #rec = 1
position (+2)
else
do l_print_data1
let #rec = #rec + 1
end-if

from noth_stock_alloc a , nomh_announcement b , comh_counter c
where a.ann_num = b.ann_num and substr(a.ann_num,5,1) = 'C' and b.stk_cd = c.stk_cd and rtrim(a.client_cd) = 'ABU' and b.payment_dt between to_date(''{i_pay_dt_fr}'',''dd/mm/yyyy'') and to_date(''{i_pay_dt_to}'',''dd/mm/yyyy'')'
order by b.payment_dt
end-select
[/sql]

this is the syntax to show client code that the staff has so probably 1 client to 1 staff.. how bout to show the 1 staff to all(many) his client?..really2 need any sifu help plss. :stars:

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-09-07 : 09:21:48
What kind of database sever are you using? This does not look like valid sql server syntax... (this is a sql server forum only)

- Lumbago
My blog-> http://thefirstsql.com/2011/07/08/how-to-find-gaps-in-identity-columns-at-the-speed-of-light/
Go to Top of Page

arthemyth
Starting Member

2 Posts

Posted - 2011-09-07 : 09:24:21
im using oracle..and that is SQR language..can u help me pls..should be complete ASAP..;(
Go to Top of Page
   

- Advertisement -