PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Database Field Value [WD 22]
Database Field Value [WD 22]
Iniciado por guest, 16,dic. 2017 08:57 - 5 respuestas
Publicado el 16,diciembre 2017 - 08:57
Hello everybody.
Maybe I overread it.
Is there a function that can determine the highest value of a field in an HFSQL database?

Best Regards
Stefan
Publicado el 16,diciembre 2017 - 10:10
Hi Stefan,

I'm sorry, there's no WLanguage function for limiting the values of fields within an HFSQL database. I'd suggest you do the checks yourself before HAdd, HModify or HSave functions. For that you can use a trigger function which will check values before being inserted into the database. This will free you automatically from checking values in every part of your program!
Publicado el 16,diciembre 2017 - 10:43
Hi,
the easiest and fastest way is to save the value in a second table. Then just compare new values with this value, if it is greater then modifiy the value in the second table.
Publicado el 16,diciembre 2017 - 11:53
HI Stefan,

not sure what exactly you would like to achieve, but using a query would do the trick i guess?

something like:

SELECT
MIN(ID) AS minid,
MAX(ID) AS maxid
FROM
PrdMain

cheers,
Sascha
Publicado el 17,diciembre 2017 - 01:52
Hello Stefan

If you index the field then HReadLast() should return the highest value

Regards
Al
Publicado el 20,diciembre 2017 - 10:42
Thanks for the comments.
I think I will use the variant of markus.k

Thanks to all who contributed here.

Best Regards
Stefan