Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Grouping Dates

Author  Topic 

makimark
Starting Member

34 Posts

Posted - 2002-03-30 : 05:01:49
Hi
I have to extract some data from my table for charting purposes. I've sort of gotten the query to work but i have an issue with the dates. In the table i track hits to a particular page.

When i try to group the dates normally (group by hitdate) then it does not correlate the dates as each one has a diefferent timestamp.

Using datepart (there is a datetime stamp for every hit) can only get
either a weekday or month or year. Is there a way to group the dates using only the date part of the datetime datatype ? maybe something like datepart(ddmmyy,hitdate) ?

Thanks

Mark


Nazim
A custom title

1408 Posts

Posted - 2002-03-30 : 07:29:19
Select convert(varchar(12),hitdate),count(*) as Hits
from tablename
group by convert(varchar(12),hitdate)


HTH

--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -