Find Transactions in Time Range, Ignoring Date
I think you will be fine using DATEPART.

Assume the following columns exist, and assume dates and times don't test for daylight saving time.

This will select all the UserIDs from a table where the time is between 1am and 5pm, since January 1st.

SELECT
    UserID,
    LoginDate
FROM
    [dbo].[LoginDates]
WHERE
    [LoginDate] &gt; '20160101'
    AND DATEPART(HOUR,[LoginDate]) &gt;= 1
    AND DATEPART(HOUR,[LoginDate]) &lt; 5


Notes:


The LoginDate &gt; '20160101' will check for all logins after midnight on the 1st of January 2016.
I'm using &gt;= and &lt; instead of BETWEEN, because it's more accurate.