>>A few days ago you were kind enough to respond to my question about GROUP BY and cdx files. Your suggestion was to do 2 sqls, one using ORDER BY and then the second one to grab the data.
>>
>>I checked my tables and program, and the payment table always is in the correct order anyway. Newer payments can only be appended to the bottom of the table. If I were to do a sql-select, I would expect to get the same cursor as the payment.dbf itself.
>>
>>Do you think that doing 2 sqls would make a difference? (Due to the intermittency of this error, it is hard to make a modification and try it because it seems to be random.) This is the only program I write and maintain, so maybe my real question is: How would a professional programmer ensure you get the last child record for all parents?
>>
>>Thanks again for your input.
>
>I can just say that from my experience GROUP always selects the last record from group. If for some reason you are not sure in this, then you can change your code making e.g. UDF with SEEK/LOCATE (i don't know what is the real situation).
Have you 'SET ORDER TO' for the tables involved in the SQL select? This removes any current 'ORDER' setting, and affects performance ( and maybe the GROUP BY record too ). Don't know if this is a 'fix', but several things happen when a DBF is already ordered upon running the SQL select.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only