converting date and grouping

  • Hello,

    I am using the following query;

    select count(*), convert(varchar,DateTime,101) from divuk group by datetime

    I would like it to count all the DateTime records that are the same and group by them but i get the following output,

    count/datetime

    1 10/10/2004

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    1 01/25/2005

    Can anyone help?

     

    thanks

  • ignore my mistake! 😮

     

    of course it wont work unless i group by the same convert!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply