U
U
user_1223242020-06-18 15:01:12
SQL Server
user_122324, 2020-06-18 15:01:12

How to get rows with current date in sql?

there is a sql query.
SELECT Userid FROM Checkinout Tell me

how to abyss WHERE CheckTime = "2020.06.18" to get all rows for the specified day?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d-stream, 2020-06-18
@user_122324

Classic variant:

where cast(datetime_field as date) = cast(getdate() as date)

Naturally, we leave the bottom of the iceberg behind the scenes in the form of timezones, etc.

V
Vladimir Korotenko, 2020-06-18
@firedragon

SELECT Userid FROM Checkinout where CheckTime like '2020.06.18%'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question