• This looks complex but will use your index.

    where CreatedDate between dateadd(dd, datediff(dd,0,Getdate()),0) --midnight TODAY

    and dateAdd(ss,-1,dateAdd(dd,1,dateadd(dd, datediff(dd,0,Getdate()),0))) --23:59:59 TODAY

    HTH

    Dave J

    Edit: Oops! I see w.lengenfelder posted this already! :w00t:


    http://glossopian.co.uk/
    "I don't know what I don't know."