Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

End User Report...Having???

edited January 2004 in End User
Hi All,

I have to get info from 2 tables and only return the records having a count
search criteria?

SELECT MEMBERS_1.UID, MEMBERS_1.FIRST_LAST,
MEMBERS_1.ADDRESS,
MEMBERS_1.CITY_STATE_ZIP,
MEMBERS_1.HOME_PHONE,
MEMBERS_1.WORK_PHONE,
MEMBERS_1.FIRST_JOIN_DATE,
MEMBERS_1.DENY_ENTRY_ON_DATE,
MEMBERS_1.MEMBERSHIP_TYPE, COUNT(*) COUNT_2
FROM ATTENDANCE ATTENDANCE_1
INNER JOIN MEMBERS MEMBERS_1 ON
(MEMBERS_1.UID = ATTENDANCE_1.MEMBER_ID)
WHERE
( MEMBERS_1.FIRST_JOIN_DATE >= '11/18/2074 00:00:00' )
AND ( MEMBERS_1.DENY_ENTRY_ON_DATE <= '03/15/1985 00:00:00' )
AND ( MEMBERS_1.PAYMENT_RESPONSIBILITY LIKE 'This%' )
GROUP BY MEMBERS_1.UID, MEMBERS_1.FIRST_LAST,
MEMBERS_1.ADDRESS,
MEMBERS_1.CITY_STATE_ZIP,
MEMBERS_1.HOME_PHONE,
MEMBERS_1.WORK_PHONE,
MEMBERS_1.FIRST_JOIN_DATE,
MEMBERS_1.DENY_ENTRY_ON_DATE,
MEMBERS_1.MEMBERSHIP_TYPE
ORDER BY MEMBERS_1.FIRST_LAST, MEMBERS_1.UID

--

Regards,
Stacey R. Brodsky
ClubRunner, Inc.
(561) 746-3392

www.clubrunner.net

Comments

  • edited January 2004

    The ReportBuilder Query tools do not support the SQL Having clause.

    You might want to consider creating a summary table and then building the
    SQL off of that.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2004
    Why not just add "and count_2 > x" to the where clause?
    Jef

This discussion has been closed.