PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → HFilter considerations
HFilter considerations
Started by guillermo, Sep., 19 2005 7:14 AM - 4 replies
Posted on September, 19 2005 - 7:14 AM
Hi Forum...
If I use HFilter(Documentos,Fecha_de_ingreso,vl_FVI,vl_FVF)all is ok
vl_FVI nad vl_FVF are date
But if I use ....
MyFilter = "Documentos.Fecha_de_ingreso >= " + vl_FVI " and Documentos.Fecha_de_ingreso <= " + vl_FVF
HFilter(Documentos,My_Filter)
or simply
MyFilter = "Documentos.Fecha_de_ingreso = " + vl_FVI
HFilter(Documentos,My_Filter)
No display records in table
any consideration to work with dates ?
Thanks .....
Guillermo
Posted on September, 19 2005 - 1:58 PM
Hola Gullermo,¨
La única cosa que tienes mal es que la fecha debes considerarla un campo
string, por lo tanto debe ir entre comillas sencillas. En el ejemplo que te
escribió Al se refleja esto.
Si quieres asignarle un valor a una fecha puedes ponerlo fecha = "20050911"
(equivalente a decir fecha = today().
Saludos,

"guillermo" <glsaavedra@adinet.com.uy> escribió en el mensaje
news:432e8e24$3@news.pcsoft.fr...

Hi Al
Ok, I will see what you suggest me.
Guillermo
G'day Guillermo
The syntax for Hfilter is quite bizarre and not intuitive. The original
Hfilter command has been augmented with HfilterIdentical,
HfilterIncludeBetween and HfilterStartsWith.
The HfilterIncludeBetween may be better to use in your circumstance and
the additional commands are more straightforward to construct than
Hfilter().
Hfilter will not return an error if it's syntax is wrong, you just won't
get any data so you do need to check the result string that it gives.
The best way to learn how to build conditional strings for hfilter() is to
use the Hcreateview() wizard as the conditional string that it builds can
be used in the Hfilter() command. In fact Hcreateview() can be used as a
replacement method to Hfilter() when extracting data.
The other function to have a look at is HBuildKey()
Try this string in your filter - use the field names without the filename.
prefix

MyFilter = "Fecha_de_ingreso >= " + "'vl_FVI +'" and Fecha_de_ingreso <=
"' + vl_FVF+"'"
or
MyFilter = "Fecha_de_ingreso >= " + vl_FVI +" and Fecha_de_ingreso <= "' +
vl_FVF+"'"
I have retyped these parts with spaces as it can be confusing with double
and single quote marks
+" ' vl_FVI + ' "
The last is " ' "


Regards
Al







Posted on September, 19 2005 - 2:31 PM
G'day Guillermo
The syntax for Hfilter is quite bizarre and not intuitive. The original Hfilter command has been augmented with HfilterIdentical, HfilterIncludeBetween and HfilterStartsWith.
The HfilterIncludeBetween may be better to use in your circumstance and the additional commands are more straightforward to construct than Hfilter().
Hfilter will not return an error if it's syntax is wrong, you just won't get any data so you do need to check the result string that it gives.
The best way to learn how to build conditional strings for hfilter() is to use the Hcreateview() wizard as the conditional string that it builds can be used in the Hfilter() command. In fact Hcreateview() can be used as a replacement method to Hfilter() when extracting data.
The other function to have a look at is HBuildKey()
Try this string in your filter - use the field names without the filename. prefix

MyFilter = "Fecha_de_ingreso >= " + "'vl_FVI +'" and Fecha_de_ingreso <= "' + vl_FVF+"'"
or
MyFilter = "Fecha_de_ingreso >= " + vl_FVI +" and Fecha_de_ingreso <= "' + vl_FVF+"'"
I have retyped these parts with spaces as it can be confusing with double and single quote marks
+" ' vl_FVI + ' "
The last is " ' "


Regards
Al
Posted on September, 19 2005 - 3:21 PM
Hi Al
Ok, I will see what you suggest me.
Guillermo
G'day Guillermo
The syntax for Hfilter is quite bizarre and not intuitive. The original Hfilter command has been augmented with HfilterIdentical, HfilterIncludeBetween and HfilterStartsWith.
The HfilterIncludeBetween may be better to use in your circumstance and the additional commands are more straightforward to construct than Hfilter().
Hfilter will not return an error if it's syntax is wrong, you just won't get any data so you do need to check the result string that it gives.
The best way to learn how to build conditional strings for hfilter() is to use the Hcreateview() wizard as the conditional string that it builds can be used in the Hfilter() command. In fact Hcreateview() can be used as a replacement method to Hfilter() when extracting data.
The other function to have a look at is HBuildKey()
Try this string in your filter - use the field names without the filename. prefix

MyFilter = "Fecha_de_ingreso >= " + "'vl_FVI +'" and Fecha_de_ingreso <= "' + vl_FVF+"'"
or
MyFilter = "Fecha_de_ingreso >= " + vl_FVI +" and Fecha_de_ingreso <= "' + vl_FVF+"'"
I have retyped these parts with spaces as it can be confusing with double and single quote marks
+" ' vl_FVI + ' "
The last is " ' "


Regards
Al
Posted on September, 20 2005 - 5:48 AM
Thanks to your help, it worked perfectly
Guillermo