SQL where datetime column equals today's date?

前端 未结 5 516
感情败类
感情败类 2021-01-31 07:08

How can I get the records from a db where created date is today\'s date?

SELECT [Title], [Firstname], [Surname], [Company_name], [Interest] 
FROM [dbo].[EXTRANET         


        
5条回答
  •  旧时难觅i
    2021-01-31 07:42

    There might be another way, but this should work:

    SELECT [Title], [Firstname], [Surname], [Company_name], [Interest] 
    FROM [dbo].[EXTRANET] 
    WHERE day(Submission_date)=day(now) and 
         month(Submission_date)=month(now)
         and year(Submission_date)=year(now)
    

提交回复
热议问题