sql - FM ExecuteSQL returns different results than direct database query -
i wondering if can explain why different results same query string between using executesql function in fm versus querying database through database browser (i'm using dbvisualizer).
specifically, if run
select count(distinct imv_itemid) imv
in dbvis, 2802. in filemaker, if evaluate expression
executesql ( "select count(distinct imv_itemid) imv"; ""; "")
then 2898. makes me distrust executesql function. inside of fm, imv table odbc shadow, connected central mssql database. in dbvis, application connects via jdbc. however, don't think should make difference.
any ideas why different count each method?
actually, turns out when fm executes sql, factors in whitespace, whereas dbvisualizer (not sure other database browser apps, assume it's same) not. also, since trim() function isn't supported mssql (from i've seen, @ least) necessary make query inside of executesql statement like:
select count(distinct(ltrim(rtrim(imv_itemid)))) imv
weird, works!
Comments
Post a Comment