Hi guys I would need advice on how to do this typology of queries are on MsMsql 2015
Sample data table:
|TimestampDate | Value|
01/01/2017 00:01:00.000 | 1
01/01/2017 00:02:00.000 | 2
02/01/2017 00:01:00.000 | 3
02/01/2017 00:02:00.000 | 4
03/01/2017 00:01:00.000 | 5
03/01/2017 00:02:00.000 | 6
SELECT
[TimestampDate],
[Value]
FROM Sample
WHERE Sample.[TimestampDate] BETWEEN '01 / 01 / 2017' AND '02 / 01 / 2017'
AND DATEPART(HOUR,[TimestampDate])=1
Result:
01/01/2017 00:01:00.000 | 1
02/01/2017 00:01:00.000 | 3
SELECT
[TimestampDate],
[Value]
FROM Sample
WHERE Sample.[TimestampDate] BETWEEN '01 / 01 / 2017' AND '02 / 01 / 2017'
AND DATEPART(HOUR,[TimestampDate]) IN(1,2)
Result:
01/01/2017 00:01:00.000 | 1
01/01/2017 00:02:00.000 | 2
02/01/2017 00:01:00.000 | 3
02/01/2017 00:02:00.000 | 4
I love using LLBLGen native Api
Thanks