Hi! I have a program connected to a database. It reads the database and displays the contents in a table and in a graph. The point is that I want the maximum value obtained on each day to appear on the graph. Can you help me?
Inês
Hi inescruz,
@inescruz32 wrote:
I want the maximum value obtained on each day to appear on the graph.
Read the data for "each day" from your database, then determine the max value.
Put those max values in an additional plot of your graph…
Hi GerdW,
I have the data organized in this way in the database. I want the program to get the maximum value for the different days. Then I want the value and the respective date to appear on the graph.
Hi inescruz,
@inescruz32 wrote:
I want the program to get the maximum value for the different days.
Use a loop to iterate over your days:
There surely is a "SELECT" command suitable for your database…
Hi GerdW,
Can you explain to me how I can do this iteration, please?
Best regards,
Inês
Something like this:
SELECT MAX(column) from TABLE where date=....
https://www.w3schools.com/sql/sql_min_max.asp
If you dig further you can probably create a SELECT command, that gives you the MAX value for each day of e.g. one month.
Regards, Jens
Google "query maximum per day"
For instance: sql server - SQL query to get maximum value for each day - Stack Overflow
It will depend on the database. SQLServer SQL isn't Access SQL.
If you want a specific day (or if you know all days from a previous query), you can do something like:
SELECT TOP 1 value FROM data WHERE date>start AND date<end ORDER BY date DESC
Each part of this query is highly googleable.
There's also the max clause:
SELECT max( value ) FROM data WHERE ...
Again, google is your friend here.
Hi JensG69,
I changed my block diagram and put up a dial that says what the maximum force was. Through the table, can I ask the labview to read it and tell me what is the maximum value for each day and show those values in a graph?
Regards, Inês