what "problem" are you having? what result do you get?
If your result is "?", try this:
and tell us what you get.
I did as you told and there was a problem with the name of one TO. i changed it and now filemakers freezes
I only use the ExecuteSQl within the data view.
How many records do you have? Left join can be quite slow in some cases...
1 of 1 people found this helpful
I found your formula to just work fine.
Put this in
Let ( [
query = "
SELECT SUM ( d.Horas )
FROM T02_Partes_DETALLES as d
LEFT JOIN T02_Partes as p
ON d.Id_detalles_parte = p.Id_parte
WHERE p.Categoria = ? AND p.Tarea = ?
query_2 = ExecuteSQL ( query ; "" ; ""; "Herbicida"; "Cuba" )
If ( query_2 = "?" ; "" ; query_2 )
and see what you get (you may need to close the Expression window to actually generate/see the error message as a result in the expression list of the Watch tab).
i got 2000 records in T02_Partes and 7000 in T02_Partes_DETALLES.
With those record counts, I would start by trying to do the SELECT from T02_Partes with a JOIN (not LEFT JOIN) to T02_Partes_DETALLES and see if that performs better.
not only that reason, David, but the children should not have 'missing' parents anyway.
Afterwards erolst reply i tried the formula in a back-up of my database and it worked fine !!
thanks everyone for your help !!