rugby148
asked on
Query with counts per group by date
Greetings.
I have a table:
ID
Field1
Timestamp (which is a populated with getdate())
I want to do a query that will respond with
date count
10/1 4
10/2 4
10/3 52
etc.
Thanks,
John
I have a table:
ID
Field1
Timestamp (which is a populated with getdate())
I want to do a query that will respond with
date count
10/1 4
10/2 4
10/3 52
etc.
Thanks,
John
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And yours won't work because you left out the GROUP BY clause. It won't parse.
Swindle said:
>>And yours won't work because you left out the GROUP BY clause. It won't parse.
Touche :)
>>And yours won't work because you left out the GROUP BY clause. It won't parse.
Touche :)
ASKER
why the 101?
rugby148,
It's a code that specifies a particular format for the results of the CONVERT expression. 101
specifies mm/dd/yyyy; any of the formats that leave off the time portion would have sufficed
for my purpose.
Regards,
Patrick
It's a code that specifies a particular format for the results of the CONVERT expression. 101
specifies mm/dd/yyyy; any of the formats that leave off the time portion would have sufficed
for my purpose.
Regards,
Patrick
The only difference in the two approaches above is that mine returns a datetime for the Date
(although the time portion will always be midnight) while Swindle's returns a varchar.
To-MAY-to, to-MAH-to, really :)
Regards,
Patrick