HyperfileSQL data sorting windev

Solved
j-psy Posted messages 231 Status Member -  
j-psy Posted messages 231 Status Member -
Hello,
I am using Windev 14, and I would like to browse a database, selecting only the records that contain a certain
string of characters in a specific field, and not all the records in the database.
For example: if I have a table containing the following data:
First Name______Record
Jean________XB92TZK
Paul________PQ547222
Chris_______XB92hyau
Sam _______TZIUQY
I would like to process only the data containing the string "XB92" in the field "Record".
Does anyone know how to go about it or at least which function to use?
Thank you.

Configuration: Windows XP / Safari 535.2

2 answers

naruto-94 Posted messages 904 Status Member 188
 
I think we need to use HFiltre.

HFiltre(Connection, Record, ["XB92"])

Something like that, it's been a while since I used WinDev.

EDIT: there's even the function HFiltreCommencePar.

HFiltreCommencePar(Connection, Record, "XB92")
1
j-psy Posted messages 231 Status Member 16
 
Hello,
thank you for your reply,
indeed after some research, I noticed that I should use the HFiltre function, but as a beginner, I have two issues with this function: --you cannot filter on non-key fields (which is my case),
-and if I want to search for characters located in the middle of the record (for example "somethingXB92else"), I’m not sure how to go about it.
Do you have any idea for these specific cases?
0
naruto-94 Posted messages 904 Status Member 188
 
I think that with the HExécuteRequêteSQL function we can do something, I think it would be enough to do:

HExécuteRequêteSQL(Req,"SELECT Prenom FROM latable WHERE Fiche LIKE '%XB92%' ")

which will return all the first names where the name of the file contains XB92.
0
j-psy Posted messages 231 Status Member 16
 
Yes, indeed, that could work, but I was asked to only use WinDev functions, and not SQL queries. So if you have any other suggestions, I would like to hear about them, thank you ^^.
0
j-psy Posted messages 231 Status Member 16
 
After some research, I solved the problem. The following syntax needed to be used:

HFiltre(NomDeLaBase,"Fiche~]'xb92'")

Here, the syntax "~]" means "contains, case insensitive."
Thank you for your help!
0