WOW...................
Michael, thank you VERY much. If you were next to me right now I'd hug you
and give you a big sloppy wet Italian kiss. :-) (Not really)
However, that's definitely worth a couple martini's at Perspectives if
you're attending. I really appreciate this.... learned something new.
THANK YOU.
Vic
-----Original Message-----
From: Michael Barry
Sent: Wednesday, January 25, 2012 4:14 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Question for Progress Query Gurus
SELECT c.company,c.name,c.custnum,quotecount,ordercount
FROM pub.customer c INNER JOIN
(
SELECT company,custnum,COUNT(*) AS quotecount FROM pub.quotehed GROUP BY
company,custnum
) q ON c.company = q.company AND c.custnum = q.custnum INNER JOIN
(
SELECT company,custnum,COUNT(*) AS ordercount FROM pub.orderhed GROUP BY
company,custnum
) o ON c.company = o.company AND c.custnum = o.custnum
Michael
Michael Barry
Aspacia Systems Inc
866.566.9600
312.803.0730 fax
http://www.aspacia.com/
This email, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
email, you are hereby notified that any dissemination, distribution or
copying of this email, and any attachments thereto, is strictly prohibited.
If you have received this email in error, please immediately notify me by
telephone and permanently delete the original and any copy of any email and
any printout thereof.
Michael, thank you VERY much. If you were next to me right now I'd hug you
and give you a big sloppy wet Italian kiss. :-) (Not really)
However, that's definitely worth a couple martini's at Perspectives if
you're attending. I really appreciate this.... learned something new.
THANK YOU.
Vic
-----Original Message-----
From: Michael Barry
Sent: Wednesday, January 25, 2012 4:14 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Question for Progress Query Gurus
SELECT c.company,c.name,c.custnum,quotecount,ordercount
FROM pub.customer c INNER JOIN
(
SELECT company,custnum,COUNT(*) AS quotecount FROM pub.quotehed GROUP BY
company,custnum
) q ON c.company = q.company AND c.custnum = q.custnum INNER JOIN
(
SELECT company,custnum,COUNT(*) AS ordercount FROM pub.orderhed GROUP BY
company,custnum
) o ON c.company = o.company AND c.custnum = o.custnum
Michael
Michael Barry
Aspacia Systems Inc
866.566.9600
312.803.0730 fax
http://www.aspacia.com/
This email, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
email, you are hereby notified that any dissemination, distribution or
copying of this email, and any attachments thereto, is strictly prohibited.
If you have received this email in error, please immediately notify me by
telephone and permanently delete the original and any copy of any email and
any printout thereof.
On Jan 25, 2012, at 7:10 AM, Vic Drecchio wrote:
> Question for Progress gurus...
>
> Is it possible to do sub queries in select statements in Progress?
>
> Simple example but, in SQL, this is a valid query:
>
> SELECT
> C.CUSTOMER,
> C.CUSTNUM,
> (SELECT COUNT(*) FROM QUOTEHED Q WHERE Q.CUSTNUM = C.CUSTNUM) AS
> ‘QUOTE_COUNT’,
> (SELECT COUNT(*) FROM ORDERHED O WHERE O.CUSTUM = C.CUSTNUM) AS
> ‘ORDER_COUNT’
> FROM CUSTOMER C
>
> How do I accomplish this in Progress? Is it possible?
>
> [Non-text portions of this message have been removed]
>
>
[Non-text portions of this message have been removed]
------------------------------------
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4765 - Release Date: 01/25/12