In this loop I am adding new record to add new search condition.
But it is always taking last 89 conditions.(ie. last 89 condition is evaluated)
So is there any find limitations ?
I have a table having fields “start_date” and “end_date”.
So each record of this table provides a datetime range from “start_date” to “end_date”.
So each record has a different range of datetime.
In the second table I have another datetime field.
I have to find all the records from the second table, whose datetime field value falls in any of the “start_date” and “end_date” range of the first table.
Since there are so many records in the first table, so we got multiple datetime ranges.
And for each range we have to specify new conditions. which is done by adding new records in the find mode.
If the are 100 records in the first table then we have 100 datetime ranges and we need 100 find records to put all the ranges.
But here it is taking the last 89. And leaving the first 11 ranges.
pradiptab:
In the second table I have another datetime field.
I have to find all the records from the second table, whose datetime field value falls in any of the “start_date” and “end_date” range of the first table.
a) There’s no other way your first and second table are connected using a pk-fk relationship?
b) Do all ranges have a tight follow up or even overlap, in other words is it possible there are gaps in the ranges of different records?
pradiptab:
And I have solved it by creating custom SQL Query by looping through the records of the first table and assigning the dataset to the foundset.
That was the solution I was thinking of too, when your answers would turn out negative
Depending on the foundset you have for table A, it can become quiet a large query, but I don’t think there’s another way to do it.
You might also consider creating a relation to your form1-table:
start >= form1tab.start_dat
end <= form1tab.end_date
The related records would be what you are looking for.
Btw, there is no limit in number of records in find mode (except that the resulting sql cannot be handled by the db which would result in an sql exception), there must be something else going on that you do not get all 100 records.