I am trying to get the records based on the DateTime column (which has both date and time) for only the records that were added during some hours like
- from 17hours to 06 hours ( which spans two days)
- 06 hours to 17 hours ( same day which is easier).
I tried the below but having issues. Any suggestions greatly appreciated.
CAST(DateTime as time)>= '17' or
CAST(DateTime as time) < '07'
the error is Conversion failed when converting date and/or time from character string