473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Crosstab query for grouping time

171 100+
Hi
I have a crosstab query which has column heading as Expr:Left([Time Field],2) & "00-" & Left([Time Field],2) & "59" which shows my columns as 0000-0059,0100-0159,0200-0259 etc upto 2300-2359.
The value field is as The Value:Count(Left([Time Field],2))which gives the count of records falling in that time range.
I need a help to do the column heading break up as
0030-0129, 0130-0229, 0230-0329, 0330-0429 etc and find the record count between that time range.
I forgot to mention that the Time Field is a time in hh:nn format.
I thank you all the experts for the help in advance

Regards
Dec 15 '13 #1
3 1317
zmbd
5,501 Expert Mod 4TB
Show us the SQL you are currently using.
Please remember to select it and format using the [CODE/] button.

(open Q.Editor in design, then switch to SQL by right clicking in a blank area of the table display)
Dec 15 '13 #2
jimatqsi
1,271 Expert 1GB
rajeevs,
You could find the minute number of the day
Expand|Select|Wrap|Line Numbers
  1. (Hour([TimeField]) *60)+Minute([TimeField]))
and divide it by 90, rounding up to whole numbers. That will give you a number between 1 and 16, which can be used to derive your column titles as you like.

However, what about the period 00:00 to 00:30. Did you mean to exclude that? That complicates things a bit because the day no longer consists of whole 90-minute periods.

Jim
Dec 15 '13 #3
rajeevs
171 100+
The Sql is as below which gives me column headings as 0000-0059, 0100-0159,0200-0259 etc and count of records between 0000-0059, 0100-0159, 0200-0259 these timings:

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM 
  2. Count(Left([TimeField],2)) AS [The Value]
  3. SELECT [Tbl].DATE1 AS [DATEFld]
  4. FROM [Tbl]
  5. GROUP BY [Tbl].DATE1
  6. PIVOT Left([TimeField],2) 
  7.     & "00-" & Left([TimeField],2)
  8.     & "59";
Dec 15 '13 #4

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

Similar topics

3
by: Tom | last post by:
I have a report based on a crosstab query that shows monthly automobile sales. The report is grouped on Make so that it shows the models under each Make. I want to now get the subtotals by Make and...
8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
3
by: Mat N | last post by:
Hi, I've been trying to work out how to create a report based on crosstab query for which the number of fields is variable. For example in a situation where you show customer billing by year in...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
2
by: access baby | last post by:
I have created a crosstab query with month value but my database contains values of year 2006 as well as 2007 how i filter in such a way that it gives me the values of 2006 and 2007 seperatly. ...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
0
by: Shalini Bhalla | last post by:
I have a crosstab query having grouping in 3 levels and i need to summup and disply total .... how can i go about it i m pasting my query $sql = 'select `main_state`,`state_name`,`gender`,'...
8
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. ...
2
sueb
by: sueb | last post by:
I have a crosstab query that gathers all records for a fiscal year specified by the user's input, then counts the number of records that fall within a specific month, grouped by a discriminant in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.