Re: Crosstab counts aggregated by day ranges
From: John Viescas (JohnV_at_nomail.please)
Date: 03/21/04
- Next message: John Viescas: "Re: Round as calculator"
- Previous message: Dennis: "Re: Round as calculator"
- In reply to: Jody: "Re: Crosstab counts aggregated by day ranges"
- Next in thread: Jody: "Re: Crosstab counts aggregated by day ranges"
- Reply: Jody: "Re: Crosstab counts aggregated by day ranges"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 21 Mar 2004 11:13:14 -0600
You don't show any criteria in your original grid - did you add some? What
does the SQL look like now?
You might need to add a convert to long:
(CLng([TermDate]-[InstallDate])\60) + 1
No, strings are just fine.
-- John Viescas, author "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ (Microsoft Access MVP since 1993) "Jody" <anonymous@discussions.microsoft.com> wrote in message news:5C23B001-026D-4EC4-A199-16A23CFF95EE@microsoft.com... > Hi John, > > Thanks very much for your advice. I put the expression in the field cell of the first design grid column containing the 'Group By' Total and 'Row Heading' Crosstab, and got 'Data type mismatch in criteria expression' returned when I ran the query. > > Just for your knowledge, the data types underlying the TermDate and InstallDate are both date/time. Could there be an issue with returning text strings to this crosstab field? > > Thanks again, > Jody > > > > ----- John Viescas wrote: ----- > > Here's one way: > > ServiceDurationDays: Choose((([TermDate]-[InstallDate])\60) + 1, " 0-59 > days", " 60-119 days", "120-179 days", "180-239 days", "240-299 days", > "300-359 days", "360-419 days", "420-479 days", "480-539 days", "540-599 > days", "600-659 days", "660-719 days", "720-779 days", "780-839 days", > "840-899 days", "900-959 days") > > Note that the leading spaces in the first two values are critical to getting > the data sorted correctly. You will have to add more values if service > duration goes beyond 959 days - with leading spaces to compensate. > > -- > John Viescas, author > "Microsoft Office Access 2003 Inside Out" > "Running Microsoft Access 2000" > "SQL Queries for Mere Mortals" > http://www.viescas.com/ > (Microsoft Access MVP since 1993) > "Jody" <anonymous@discussions.microsoft.com> wrote in message > news:0D12906E-04DB-492C-B6AA-ECA004327FEC@microsoft.com... > > Hi all, > >> I'm creating a crosstab which uses a column heading field of Reason (a > field which holds 1 of 10 data values representing reasons for terminating a > service). The value is a count of the occurence of Reason. The Row Heading > is ServiceDurationDays, the subtraction of TerminDate - InstallDate, which > yields a row of numbers, each representing a number of days the service was > utilized. Some of these numbers have corresponding count values in a Reason > column or two, others have no Reason count values, because none was recorded > for a TerminDate. The design grid looks like this: > >> Column 1 > Column2 Column 3 > >> Field: ServiceDurationDays: [TermDate]-[InstallDate] > Reason Reason > > Table: > qryTerminDates qryTerminDates > > Total: Group By > Group By Count > > Crosstab: Row Heading > Column Heading Value > > Sort: > > Criteria: > >> Currently I am getting 983 dynaset records. The column reasons and count > values are showing fine, but the ServiceDurationDays are broken down too > finely. What I need is to have the ServiceDurationDays consolidated into 60 > day 'buckets', aggregating the column reason count values accordingly. > >> Any help is greatly appreciated. > >>> Cheers, > > Jody > >>>>>
- Next message: John Viescas: "Re: Round as calculator"
- Previous message: Dennis: "Re: Round as calculator"
- In reply to: Jody: "Re: Crosstab counts aggregated by day ranges"
- Next in thread: Jody: "Re: Crosstab counts aggregated by day ranges"
- Reply: Jody: "Re: Crosstab counts aggregated by day ranges"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|