A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstabs with between..



 
 
Thread Tools Display Modes
  #1  
Old March 10th, 2010, 12:09 PM posted to microsoft.public.access
MorganJ
external usenet poster
 
Posts: 1
Default Crosstabs with between..

Hi
trying to make a crosstab with data who tells me how many cars goes where
to, (which city), in which period (Time of day)

Something like this:

TO 00:00-07:59 08:00-15:59 16:00-23:59
Oslo 2 3 6
London 3 6 12
Paris 1 0 0

Can you help me?
  #2  
Old March 10th, 2010, 01:05 PM posted to microsoft.public.access
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Crosstabs with between..

hi Morgan,

On 10.03.2010 13:09, MorganJ wrote:
trying to make a crosstab with data who tells me how many cars goes where
to, (which city), in which period (Time of day)


Can you help me?

Sure, but a concise and complete example is necessary. I couldn't guess
your neither your table structure nor your sample data.



mfG
-- stefan --
  #3  
Old March 10th, 2010, 01:53 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Crosstabs with between..

First create a query something like below so that the data will show with the
appropriate headers.

SELECT tblDateTimes.*, IIf(DatePart("h",[DateAndTime])
Between 0 And 7,"00:00-07:59",
IIf(DatePart("h",[DateAndTime]) Between 8 And 15,
"08:00-15:59","16:00-23:59")) AS [TheTimes]
FROM tblDateTimes;

Then use this first query as the record source for the crosstab.

Warning: The query above will display 16:00-23:59 for records in the date
time field. If you have any, you may want to trap the null first.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"MorganJ" wrote:

Hi
trying to make a crosstab with data who tells me how many cars goes where
to, (which city), in which period (Time of day)

Something like this:

TO 00:00-07:59 08:00-15:59 16:00-23:59
Oslo 2 3 6
London 3 6 12
Paris 1 0 0

Can you help me?

  #4  
Old March 10th, 2010, 02:50 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Crosstabs with between..

Meaant to type "for NULL records in the date"
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Jerry Whittle" wrote:

First create a query something like below so that the data will show with the
appropriate headers.

SELECT tblDateTimes.*, IIf(DatePart("h",[DateAndTime])
Between 0 And 7,"00:00-07:59",
IIf(DatePart("h",[DateAndTime]) Between 8 And 15,
"08:00-15:59","16:00-23:59")) AS [TheTimes]
FROM tblDateTimes;

Then use this first query as the record source for the crosstab.

Warning: The query above will display 16:00-23:59 for records in the date
time field. If you have any, you may want to trap the null first.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"MorganJ" wrote:

Hi
trying to make a crosstab with data who tells me how many cars goes where
to, (which city), in which period (Time of day)

Something like this:

TO 00:00-07:59 08:00-15:59 16:00-23:59
Oslo 2 3 6
London 3 6 12
Paris 1 0 0

Can you help me?

  #5  
Old March 17th, 2010, 01:34 PM posted to microsoft.public.access
joelgeraldine
external usenet poster
 
Posts: 201
Default Crosstabs with between..

pppppjjhhh

"MorganJ" a écrit dans le message de
groupe de discussion : ...
Hi
trying to make a crosstab with data who tells me how many cars goes where
to, (which city), in which period (Time of day)

Something like this:

TO 00:00-07:59 08:00-15:59 16:00-23:59
Oslo 2 3 6
London 3 6 12
Paris 1 0 0

Can you help me?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.