Board index » delphi » Getting record count of detail table
Jim Andrews
![]() Delphi Developer |
Fri, 05 Dec 2003 06:56:20 GMT
|
Jim Andrews
![]() Delphi Developer |
Fri, 05 Dec 2003 06:56:20 GMT
Getting record count of detail table
This should be easy but it has me stumped.
I want to have a calculated field in the master table with the record When I try and use the oncalcfields event as follows: procedure TDM.MasterTableCalcFields(DataSet: TDataSet); The count shows as the count of the displayed record in the DBGrid - not Ideas? ...Jim |
M.H. Avegaar
![]() Delphi Developer |
Fri, 05 Dec 2003 22:33:55 GMT
Re:Getting record count of detail tableCorrect, you'll need an additinal TQuery to do the counting, e.g.: DetailCountQuery.SQL.Text := procedure TDM.MasterTableCalcFields(DataSet: TDataSet); "Jim Andrews" <j...@azdogs.com> schreef in bericht Quote> This should be easy but it has me stumped. |
Jim Andrew
![]() Delphi Developer |
Sun, 07 Dec 2003 13:04:05 GMT
Re:Getting record count of detail tableThanks. I was hoping for a way not to spend the extra time required for a query. In the finally statement did you mean close rather than open? Is it faster if the query has less than all of the fields? Will a prepare speed it up? ...Jim Quote"M.H. Avegaart" wrote: |
M.H. Avegaar
![]() Delphi Developer |
Sun, 07 Dec 2003 16:12:59 GMT
Re:Getting record count of detail table"Jim Andrews" <j...@azdogs.com> schreef in bericht news:3B302EC5.DE08E195@azdogs.com... Quote> Thanks. I was hoping for a way not to spend the extra time required for a Quote> Is it faster if the query has less than all of the fields? COUNT(SingleFieldName) is faster. Quote> Will a prepare speed it up? Quote> ...Jim |
Sundial Services International, In
![]() Delphi Developer |
Sun, 07 Dec 2003 21:09:18 GMT
Re:Getting record count of detail tableQuoteIn article <3B302EC5.DE08E...@azdogs.com>, Jim Andrews <j...@azdogs.com> wrote: If you need to display the records, then go ahead and use a query that Don't overlook in-memory storage of the returned data ... any workstation Quote
|
1. Detail Table, Filtered & Record Count
2. Figure out record count in the Detail side of a Master/Detail setup
3. How to get Record Count of a Detail Record in DBGrid
4. existence of detail record in detail table
5. Problem when inserting records in the detail table (master/detail relation)
6. Delete records from detail table (in master detail)
7. Counting Detail records with SQL or Recordcount
8. Counting Sub-Detail Records