If I understand correctly:

time-stamp is not a data/time as such: 
http://msdn2.microsoft.com/en-us/library/aa260631(SQL.80).aspx
timestamp is a  data type that exposes automatically generated binary
numbers, which are guaranteed to be unique within a database. timestamp
is used typically as a mechanism for version-stamping table rows. The
storage size is 8 bytes.

datetime:
Date and time data from January 1, 1753 through December 31, 9999, to an
accuracy of one three-hundredth of a second (equivalent to 3.33
milliseconds or 0.00333 seconds). Values are rounded to increments of
..000, .003, or .007 seconds, as shown in the table.



So I don't think you can group time-stamp data type that way?  at least
for MS SQL 2000.


 

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 01, 2007 11:21 AM
To: SQL
Subject: MS SQL Server: grouping date-time values

I have a table with records containing a time-stamp field.

I want to query this data grouped by various time ranges such as hour,
day, week and month. I want to count and sum data in other fields based
on these time ranges.  Why syntax am I looking for to parse date time
values so that I can group them by various units?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2988
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6

Reply via email to