PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Hyperfile select sum query
Hyperfile select sum query
Débuté par Anthony, 01 juil. 2008 13:09 - 4 réponses
Posté le 01 juillet 2008 - 13:09
Hi all, new to working with windev and I've had a look for a hyperfile command that will work the same/similar to sql: select sum(movelineid) from movementline where moveid = 2

I basically want to cound all the entries in a hyperfile that has a specific foreign key id. Is there an easy command for this or will i have to do a hreadseek and a while loop?
ta
Posté le 01 juillet 2008 - 17:29
Anthony,

It depends on your requirements, but certainly WINDEV can do this very simply. You need to look at the QUERY EDITOR - a "wizard" type editor designed for people with little or no SQL knowledge, but equally can generate complex queries very quickly :-)

Once you've "played" with this for a while, it should all become clearer.

It gives you a graphical and an SQL view of what you are building. If I remember correctly, I think the options you are looking for are on the right hand side of the QUERY EDITOR window.

One thing to keep in mind when using the native SQL implementation within WINDEV - it's not a full ANSI implementation :-( so there are quite a few of the "fancy" ANSI SQL commands/functions/features that can be done (directly) with native WINDEV SQL.

Hope this help...

Regards,
Darren.
Posté le 02 juillet 2008 - 15:09
Hi, thanks for the reply but I'm looking for a hyperfile command to do this not the SQL. I tried to explain what I needed using SQL (as I know what I want using SQL) and was just wondering if there was a simple HF command to do this as I don't have much of a clue about the hyperfile commands.
Thanks
Posté le 02 juillet 2008 - 17:58
Anthony,

In that case, we were both correct, as suggested you can use FOR/NEXT functionality and keep track of the totalling yourself.

Equally, my original suggestion also still stands - you could generate the SQL statement using the Query Editor, save the query and then use the Hyper File command "HExecuteQuery" to dynamically run your SQL from anywhere in your application.

There's lots of info. on how to use both of these techniques in the Help system.

Regards,
Darren.
Posté le 02 juillet 2008 - 19:56
cool cool thanks - didn't realise I could write SQL scripts to run on hyperfiles. I'll give that a try..