Hi,

I have a form with table A as datasource. I'm trying to add the
following criteria to the datasource in the init() section:

(
   A.StartDate < parmDate  ||
   (
       A.StartDate == parmDate &&
       A.StartTime <= parmTime
    )
)

Field StartDate is a DATETIME field while StartTime is INTEGER.

This is what I've been trying:

str                    queryExpr;

queryExpr = strFmt('((%1.%2 < ' + date2str(parmDate(),-1,-1,-1,-1)
            + ') || ((%1.%2 == ' + date2str(parmDate(),-1,-1,-1,-1) 
            + ') && '(%1.%3 <= ' + time2str(parmTime(),-1,-1)
            + ')))',
            qbd.name(),
            field2str(A, StartDate),
            field2str(A, StartTime));

qbd.addRange(A, recId).value(queryExpr);


In the debugger it is displaying correctly:
((A.StartDate < 01/10/2005) || ((A.StartDate == 01/10/2005) &&
(A.StartTime <= 09:00:00)))

but it giving error like syntax error/range errors. When I checked
the actual SQL Server being sent (logging in TOOLS/OPTIONS/SQL) the
date is being completely screwed while a whole lot of brackets are
being added.

Can anybody shed some light?
Thanks
Kevin






SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to