2PTTechnology

The platform that enables you to build rich, interactive communities
Welcome to 2PTTechnology Sign in | Join | Help
in Search

Search by a date range without the time.

Last post 07-25-2008, 10:19 AM by twaligora. 0 replies.
Sort Posts: Previous Next
  •  07-25-2008, 10:19 AM 186

    Search by a date range without the time.

    Declare @FromDt Datetime, @ToDt Datetime

    Set @FromDt = '1/1/08'

    Set @ToDt = getdate()

     

    select * from mytable

    where

    DATEDIFF( d, @FromDt,  myDateField) >= 0 and DATEDIFF(d, @ToDt, myDateField) <= 0

View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems