469,926 Members | 1,980 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Plot Interval in SQL

Hi

This is probably not very difficult but I can't seem to get it.

I have a table with 2 colums. Type (int) and timestamp (datetime). A small snippet below. What I need to do is count number or Type occurances over a time interval percentage of an overall timespan to chart the rate. ie If I select a timespan of 1 hour (between 8:00 and 9:00) then say every 5 minutes I want to know the difference between the previous 5minutes and the next 5 minutes for all instances of a given type. This will be used in a rate chart over the selected 1 Hour timespan which would plot 12points for each type. Any help will be much appreciated.

type Timestamp
403 2007-07-17 08:23:54.000
402 2007-07-17 08:23:54.000
403 2007-07-17 08:23:56.000
404 2007-07-17 08:23:56.000
454 2007-07-17 08:23:58.000
202 2007-07-17 08:23:58.000
454 2007-07-17 08:23:58.000
404 2007-07-17 08:23:58.000
405 2007-07-17 08:23:58.000
405 2007-07-17 08:23:58.000
Jul 19 '07 #1
0 765

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by toton | last post: by
6 posts views Thread by redcic | last post: by
1 post views Thread by jyothik | last post: by
4 posts views Thread by jyothik | last post: by
reply views Thread by meggahertz | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.