Search This Blog

Tuesday, December 29, 2009

%EffDtCheck

The following example uses the %EffDtCheck meta-SQL statement, which expands into an

effective date sub-query suitable for a WHERE clause. &DATE has the value of 01/02/1998. The &REC object has an EFFDT key field. The following code sample


 

SQLExec("SELECT FNUM FROM PS_REC A where %EffDtCheck(:1, A, :2)", &REC, &DATE);

resolves into the following:

"Select FNUM from PS_REC A where EFFDT = (select MAX(EFFDT)

from PS_REC

where PS_REC.FNUM = A.FNUM

and PS_REC.EFFDT <= %DateIn('1998-01-02') )"

No comments:

Post a Comment