sql group by datetime by date part and ignore time

Latest post 05-21-2009 8:13 PM by Pat. 0 replies.
  • 05-21-2009 8:13 PM

    • Pat
    • Top 10 Contributor
      Male
    • Joined on 04-27-2008
    • Tempe, AZ
    • Posts 45

    sql group by datetime by date part and ignore time

     

    select

    convert(char(10), [LogDate], 101), count(*) from [Logs]

    group by convert(char(10), [LogDate], 101)

    order by convert(char(10), [LogDate], 101) desc

    Patrick McNamara, BS-IS/CS, MBA, MAED
    ASP.NET Web Application Developer
    Asteryx, LLC.
    http://asteryx.com
    pat@asteryx.com

    Filed under: , , , ,
Page 1 of 1 (1 items) | RSS
Forums to discuss Microsoft ASP.Net Development and SQL
Powered by Community Server (Non-Commercial Edition), by Telligent Systems