locked
Get current Date Record RRS feed

  • Question

  • Hi,

    I trying to get current date records form a table.  When i am trying to get the current date records i am facing problem.   I have used following query to get

    1. (convert(varchar, followupdate, 101) BETWEEN DATEADD(d, -1, GETDATE()) AND GETDATE())

    can any one please suggest me.

     

    Regards,

    Jeevan.

     

    Thursday, August 5, 2010 5:25 AM

Answers

  • SELECT * FROM tb WHERE dt >=DATEADD(d,DATEDIFF(d,0,GETDATE()),0)

    AND dt <DATEADD(d,DATEDIFF(d,0,GETDATE()),0)+1


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Marked as answer by yjeevanrao Thursday, August 5, 2010 6:07 AM
    Thursday, August 5, 2010 5:30 AM