PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Query works in preview but not in program
Query works in preview but not in program
Iniciado por gallen.dbmc, 11,ago. 2015 19:39 - 1 respuesta
Publicado el 11,agosto 2015 - 19:39
I have a query which works when previewed, returning 125 records out of 13372 but when I run it in my program:
HExecuteQuery(QRY_BurialPeriod)
nCount = HNbRec(QRY_BurialPeriod)
returns 13372
The Query is:
SELECT
RTRIM(burial.Last_Name) +', ' + RTRIM(burial.First_Name) AS cFullName,
burial.Sex AS Sex,
burial.Burial_Type AS Burial_Type,
Burial_Date AS Burial_Date,
ROUND(MONTHS_BETWEEN(burial.Death_Date, burial.Birth_Date)/12,0) AS Age
FROM
burial
WHERE
burial.Burial_Date BETWEEN {gdReport_Start} AND {gdReport_End}
ORDER BY
cFullName ASC
Publicado el 12,agosto 2015 - 02:51
I guess it is a mistake made by a beginner!
Changing
HExecuteQuery(QRY_BurialPeriod) to
HExecuteQuery(QRY_BurialPeriod,hWithFilter,gdReport_Start,gdReport_End)
solved my problem (although I had some trouble entering it into the code editor because it kept thinking I was done after entering QRY_BurialPeriod, and I had to type the entire line)