[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Syntax for Count(*)
- Subject: Re: Syntax for Count(*)
- From: "Kibler, Daniel R - CFC" <Kibler.Daniel@CFWY.COM>
- Date: Thu, 1 Apr 1999 16:58:36 -0800
Is the layout correct? You can't have non-SQL lines (eg, let ...) start in
the 1st column.
You also need to group on erncd.
Daniel Kibler
Cambridge Technology Partners
925 543-4612
503 471-5111 Client site
-----Original Message-----
From: Bryan Richey [mailto:b_richey@YAHOO.COM]
Sent: Thursday, April 01, 1999 12:08 PM
To: Multiple recipients of list SQR-USERS
Subject: Syntax for Count(*)
Hello all!
I am trying to populate the dynamic headings that follow
....I was
wondering if someone has any insight to the correct syntax
for the
count(*)...I am currently getting a mess of SQL errors...
Thanks,
Bryan
!******************************************************
begin-procedure Determine-Sequence
!******************************************************
create-array name=ERNmtx size=11 field=ERNttl:char
do erncd-detail
end-procedure
!******************************************************begin-procedure
erncd-detail
!******************************************************
let #ERNctr = 0
begin-select
b.erncd
count(*) &b.count
let $E.ERNCD = &b.erncd
let #ERNctr = #ERNctr + 1
let ERNmtx.ERNttl(#ERNctr) = &b.count
if #ERNctr >= 10
exit-select
end-if
from ps_dhm_emp_detail b
where b.DEPTID = $V_DEPTID
and b.paygroup = $V_PayGroup
and b.pay_end_dt = $V_Pay_End_dt
and b.DHM_WEEK_NBR = #V_Week_Nbr
order by 2 desc, 1
!group by $E.ERNCD
!group by b.erncd
end-select
let $H01 = ERNmtx.ERNttl(1)
let $H02 = ERNmtx.ERNttl(2)
let $H03 = ERNmtx.ERNttl(3)
let $H04 = ERNmtx.ERNttl(4)
let $H05 = ERNmtx.ERNttl(5)
let $H06 = ERNmtx.ERNttl(6)
let $H07 = ERNmtx.ERNttl(7)
let $H08 = ERNmtx.ERNttl(8)
let $H09 = ERNmtx.ERNttl(9)
let $H10 = ERNmtx.ERNttl(10)
display $h01
end-procedure
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com