PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → How to Use HFilter on Dates?
How to Use HFilter on Dates?
Iniciado por randd4, 22,nov. 2016 21:40 - 2 respuestas
Publicado el 22,noviembre 2016 - 21:40
I can't get HFilter() to work on dates. Here's my code so far.
sStart_Date is string = DateToString(tblReminderCards.StartingDate,"YYYYMMDD")
sEnd_Date is string = DateToString(tblReminderCards.EndingDate,"YYYYMMDD")
sDateRange is string = HFilter(QRY_JobSites,QRY_JobSites.NextService,sStart_Date,sEnd_Date)
Info(sStart_Date,sEnd_Date,QRY_JobSites.NextService,sDateRange)
HReadFirst(QRY_JobSites,sDateRange)
WHILE HOut() = False
HReadNext(QRY_JobSites,sDateRange)
END
HDeactivateFilter(QRY_JobSites)
Miembro registrado
102 mensajes
Publicado el 23,noviembre 2016 - 11:01
Justin,

seems like you use queries already. So why don't you use parameters in your query? Wouldn't that be more efficient than using a query first then HFilter?

Sebastian

--
http://arnoldconsult.de
WinDev 21 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL
Publicado el 23,noviembre 2016 - 15:55
Hi

1. the datetostrings should not be needed, as a date is STORED as
YYYYMMDD by default

2. As you are not telling us what your query is doing and what it
returns, we cannot be sure that the date format in it is YYYYMMDD,
you'll need to check that.

3. You are not giving us the result of the info, so we have no way of
knowing if anything has the correct content

4. You are not telling us what the problem is (no result, wrong result,
what result?)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 11/22/2016 à 3:40 PM, Justin a écrit :
I can't get HFilter() to work on dates. Here's my code so far.
sStart_Date is string =
DateToString(tblReminderCards.StartingDate,"YYYYMMDD")
sEnd_Date is string = DateToString(tblReminderCards.EndingDate,"YYYYMMDD")
sDateRange is string =
HFilter(QRY_JobSites,QRY_JobSites.NextService,sStart_Date,sEnd_Date)
Info(sStart_Date,sEnd_Date,QRY_JobSites.NextService,sDateRange)
HReadFirst(QRY_JobSites,sDateRange)
WHILE HOut() = False
HReadNext(QRY_JobSites,sDateRange)
END
HDeactivateFilter(QRY_JobSites)