how to filter by date and time?

Solution 1:

You need to extract the time for the filtering on time. First fix:

filter(hour(Date_Measure) >= 18 & hour(Date_Measure) <= 6)

Next problem: a number can't be >= 18 and <= 6. You need or here. (Assuming you want night times. If you want day times, keep the & and switch your <= and `>=.) Second fix:

filter(hour(Date_Measure) >= 18 | hour(Date_Measure) <= 6)