Article Details
Id:11007
Product:finPOWER Connect
Type:FIX
Version:1.06.07
Opened:21/03/2013
Closed:21/03/2013
Released:27/03/2013
Job: J011349

Select Query Builder fails to get record count if 'Order By' included and gives incorrect result is using 'Group By'

The Select Query Builder business layer object fails to get record count if 'Order By' is included.

The following code would previously have caused an error:

Dim RecordCount As Integer

sqb = finBL.Database.CreateSelectQueryBuilder()
With sqb
  .Table = "Client"
  .Fields.AddList("ClientId,Name,DateOfBirth,Gender")

  .OrderByFields.Add("ClientId")
End With

If Not sqb.GetRecordCount(RecordCount) Then
  Main = False
End If

Also, it a 'Group By' was included in the Query, the Record Count would only have been returned from the first record in the result set rather than all records.

NOTE: This only applies to the ISSelectQueryBuilder object and does not change the behavior of ISDatabaseHandler.GetRecordCount.