>Hi Everybody,
>
>I have included a calculated field in a table (using SDT). Then I use this calculated field in the Stonefield Reports.
>
>The calculated field is
DATE_FLD1 - DATE_FLD2 and it works.
>
>But when I included the MAX in the calculated field as
>
>
>MAX((DATE_FLD1 - DATE_FLD2),0)
>
>
>I get error message about missing ")" in a function name.
>
>The error is generated by method ExecuteSqlSelect of class SfDataEngineVFP.
>
>This seems like a problem with SFReports and not with the MAX()used in the calculated field expression. Does this seem like the correct assumption?
>
>Thank you.
max() and min() are always problematic in SQL - SELECT statements, because they have another meaning: the maximum value for a single field, within a set of grouped records.
Replace it with an iif(), for example:
iif(date_fld1 - date_fld2 > 0, date_fld1 - date_fld2, 0)
... or create a UDF:
MyMax(date_fld1 - date_fld2, 0)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)