I am quite new using SQL and in that specific case MS query. I have to extract data from a factory database where data are recorded every 5-7 seconds, using excel and ms query. To be able to complete my analysis, I have to use one year set of data. But of course getting every value recorded every 5 seconds on one year will not be possible with excel. So I would like to extract only one value per hour (that can be one value, or an average of all the data in the past hour), but I didn't succeed. I tried to use a GROUP BY, but I only get errors. I saw someone using a DATEADD but in SQL language, doesn't work with ms query. So if any of you had a solution ?
As requested, some more information : - my organization is limiting the software we can use and what we can install. That's the reason for the choice of MS query in Excel. Not sure I can install anything else, especially for accessing databases, as IT would not allow it. - as guessed, I use only 2 fields, the time_field and value_field. data are like this :
IP_TREND_TIME IP_TREND_VALUE
01/01/2018 00:00 26.05134583
01/01/2018 00:00 28.601511
01/01/2018 00:00 25.26741219
01/01/2018 00:00 28.2553215
01/01/2018 00:00 25.7881279
01/01/2018 00:00 22.28141594
01/01/2018 00:01 25.02994537
01/01/2018 00:01 25.80338669
01/01/2018 00:01 28.67017555
01/01/2018 00:01 29.755476
01/01/2018 00:01 27.90055084
01/01/2018 00:01 30.32291794
01/01/2018 00:02 29.48653221
01/01/2018 00:02 29.06977081
01/01/2018 00:02 28.34592438
01/01/2018 00:02 24.93743706
01/01/2018 00:02 25.89684677
01/01/2018 00:02 29.04116058
01/01/2018 00:03 28.382164
01/01/2018 00:03 26.18581581
01/01/2018 00:03 26.03513527
my current query is :
SELECT TREND_TIME, TREND_VALUE
FROM my database
WHERE TREND_TIME>? And TREND_TIME<?
ORDER BY TREND_TIME
As you can see on the list of data, I have plenty of lines and would like to extract only one from this list, that can be one value or the average of all the values in the hour. And as said above, DATEADD is noot known in MS QUery, unfortunately....
Hope I was clearer this time in my explanations Thanks and regards Makol