SELECT DISTINCT PSQRYFIELD.QRYNAME , PSQRYFIELD.QRYFLDNAME , PSQRYFIELD.FIELDNAME FROM PSQRYFIELD , PSDBFIELD WHERE (PSQRYFIELD.FIELDNAME = PSDBFIELD.FIELDNAME AND PSDBFIELD.FIELDTYPE=6) AND PSQRYFIELD.COLUMNNUM > 0 AND PSQRYFIELD.SELNUM = 1 AND PSQRYFIELD.QRYFLDNAME <> ' ' UNION SELECT DISTINCT PSQRYFIELD.QRYNAME , PSQRYFIELD.QRYFLDNAME , PSQRYFIELD.FIELDNAME FROM PSQRYFIELD , PSQRYEXPR WHERE (PSQRYFIELD.QRYNAME = PSQRYEXPR.QRYNAME AND PSQRYFIELD.FLDEXPNUM = PSQRYEXPR.EXPNUM AND PSQRYEXPR.FIELDTYPE=6) AND PSQRYFIELD.COLUMNNUM > 0 AND PSQRYFIELD.SELNUM = 1 AND PSQRYFIELD.QRYFLDNAME <> ' '
|