For SQL you need to CONVERT
the date
SELECT CONVERT(VARCHAR(10), DATE_PEREMPTION, 112) AS TIME_PERIOD, AVG(MESURE) AS MESURE
...
GROUP BY TIME_PERIOD
ORDER BY TIME_PERIOD
This might be a useful reference : https://www.sqlservertutorial.net/sql-server-system-functions/convert-datetime-to-string/
I solved using this code.
SELECT cast(DATE_PEREMPTION as date) as DATE_PEREMPTION, ROUND(STDEV(MESURE),3) AS MESURE
FROM [MECMAS].[dbo].[T_Batch] B Join [MECMAS].[DBO].[TR_BATCH_MP] MP ON ([MP].ID_BATCH =B.ID )
Join [mecmas].[dbo].[T_DONNEES] d on (d.ID=MP.ID_DONNEES)
WHERE B.DATE_PEREMPTION >= '2022-01-01 00:00:00.00' AND NAME='AGUA' group by cast(DATE_PEREMPTION as date) ORDER BY DATE_PEREMPTION
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.