COUNT Without GroupBy or Aggregate

Results 1 to 2 of 2

Thread: COUNT Without GroupBy or Aggregate

  1. #1
    Join Date
    Dec 1969

    Default COUNT Without GroupBy or Aggregate

    I want to return the record count without using the recordset.recordcount method...<BR><BR>The following sql...<BR><BR>SELECT DISTINCT COUNT(PltIdx.PlatBook) AS RecCnt, PltIdx.PlatBook, PltIdx.PlatPage, PltIdx.PlatPageSfx, PltIdx.SubName, PltIdx.Developer, PltIdx.Township, PltIdx.Range, PltIdx.SubPhase, PltIdx.SubAddition, PltIdx.SubSection, PltIdx.SubRevision FROM PltIdx WHERE PltIdx.PlatBook = 44 ORDER BY PltIdx.PlatBook <BR><BR>Gives me the following error...<BR><BR>Column &#039;PltIdx.PLATBOOK&#039; is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.<BR><BR>The problem is that that I don&#039;t necessarily want to be grouped by the count field because if users select other criteria like say ONLY PltIdx.SubName, then I do NOT want the resultset grouped by the COUNT field...<BR><BR>I know I can use the recordcount method, but I wish to open the cursor as forward only...<BR><BR>Thanks In Advance...<BR><BR>KLC<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: COUNT Without GroupBy or Aggregate

    just group by every field in the selectlist except pltId.Platbook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts