473,473 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Record count between 15 minute interval

171 New Member
I have a field in a table with field type as Date/Time and the format for the field is Short Time.
I need to get the count of records between 15 minutes interval.
Example :
Tbl Structure as
Fld1 as Text
Fld2 as Date/Time
Fld3
Fld4
etc

If the records are like below
rec1 00:12
rec2 00:14
rec3 00:16
rec4 00:32
rec5 00:31
rec6 00:45
I need to get the count of records between 00:00 to 00:15
00:15 to 00:30 like that for 24 hour period.
like a cross tab query result with column heading as
00:00-00:15 00:16-00:30
Pls Help
Thank you all
Jan 10 '11 #1
6 5371
Rabbit
12,516 Recognized Expert Moderator MVP
Convert the time into number of minutes, subtract 1, integer division by 15, and that will give you the 15-minute-index.
Jan 10 '11 #2
rajeevs
171 New Member
Thank you for the quick response. I am breaking my head to create the criteria you mentioned. Can you pls explain how to put the criteria and one more thing I would like to clarify that the result I am looking for is the count between the time period and i don't want to round the time to nearest 15 minutes to find the count.
Thank you once again
Jan 10 '11 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Expand|Select|Wrap|Line Numbers
  1. Int(([Number of Minutes] - 1) / 15)
That gives you the 15-minute-index that the time falls under.

1 minute to 15 minutes will be index 0
16 to 30 = 1
31 to 45 = 2
46 to 60 = 3
61 to 75 = 4

Group by this expression and it will do the count by 15 minute intervals.
Jan 10 '11 #4
rajeevs
171 New Member
Thank you so much Rabbit. It worked perfect. Only a small (very small) problem is that after grouping I need to convert the column heading manually to look like
00:00 - 00:15 00:16 - 00:30.
Once again thank you & Bytes team
Jan 11 '11 #5
Rabbit
12,516 Recognized Expert Moderator MVP
No problem, good luck.

The (index + 1) times 15 will give you the end of the range. If you subtract 14 from the end of the range, it will give you the start of the range.
Jan 11 '11 #6
rajeevs
171 New Member
Thank you once again
Jan 12 '11 #7

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

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
3
by: thomasp | last post by:
I am trying to get a record count of a PHP query on a MS Acess database using ODBC with a DSN for MS ACCESS connection. I got this code from the PHP manual user notes. It seems to return the...
1
by: Ryan | last post by:
I've got a problem I have't run up against before. I generally test for an empty recordset using BOF and EOF. Today, for the first time I ran into a problem where my recordset shows BOF and EOF =...
1
by: darrel | last post by:
I'm trying to whip up a fancy repeater control that will put records into a two-column table for me. This is how I envision it working: itemtemplate if record count = odd then write out the...
7
by: Mike | last post by:
I have a form where I have turned off the default navigation buttons. I then created my own. This works fine. The only questions that I have is on the default navigation buttons it shows total...
4
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
2
by: Pramod Kadur | last post by:
Using borland c++, how can we fetch the record count in the following case: Suppose in XY table, First column A B ...
7
by: hjohnson | last post by:
Within the access environment, I have a table that I'd like to -add a column -place the record number of each record into that column The autonumber is not working for me because I am...
7
by: CampbellJD1 | last post by:
I am using Access 2003 Professional. I have been working with Access for some time and I have created an MDB with a Linked Table and the Data there is temporarily transferred to other Table for...
2
by: John | last post by:
Hi I am using the below statement; Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable) How can I now check the record count of the data table and specifically if the record count returned by...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.