问题
Using VB to query an access .mdb database via ADODB.
My date column holds both date and time, I would like to to build a query which will ignore the date, and refer only to the time in that column, in such a way, that will enable me to return records that have their time in between a range given by the user, ignoring the date.

I tried selecting between numbers, but I believe access I'm doing it wrong
...WHERE [Date_Time_Of_Birth] Between #04:00:00# and #06:00:00#
Just doesn't work as intended ... need a direction here.
回答1:
Use the TimeValue Function to ignore the date portion of your Date_Time_Of_Birth values.
Also #04:00:00# and #06:00:00# are 4 and 6 AM. Since you want PM times, write the values as in one of these examples:
WHERE TimeValue([Date_Time_Of_Birth]) Between #16:00:00# and #18:00:00#
WHERE TimeValue([Date_Time_Of_Birth]) Between #4 PM# and #6 PM#
来源:https://stackoverflow.com/questions/29568843/access-ado-query-between-two-hour-ranges