Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Fri, 4 Jul 2008 04:09:00 -0700,    group: microsoft.public.access.gettingstarted        back       


Crosstab Date Range Problem   
Hi hope someone can help with an annoying crosstab problem.

I have set up a crosstab query to show sales qty to each customer, by month, 
over a consecutive period January 2006-July 2008. I use the DatePart function 
to look at the sales date and get the month number. The problem is when I run 
my query it sums April 2006 sales with April 2007 sales and April 2008 sales 
etc because it sees them all as month 4 irrespective of year. So I end up 
with only months 1-12 as my column headings when I really want them to read 
left to right in chronological order Jan 2006, Feb 2006 ...... July 2008.

TIA
date: Fri, 4 Jul 2008 04:09:00 -0700   author:   Al

RE: Crosstab Date Range Problem   
If you use month number in isolation then it will compile the months from 
each year. You haven't stated your set up but I would probably use

expr1: format([sales date], "mm-yy")



"Al" wrote:

> Hi hope someone can help with an annoying crosstab problem.
> 
> I have set up a crosstab query to show sales qty to each customer, by month, 
> over a consecutive period January 2006-July 2008. I use the DatePart function 
> to look at the sales date and get the month number. The problem is when I run 
> my query it sums April 2006 sales with April 2007 sales and April 2008 sales 
> etc because it sees them all as month 4 irrespective of year. So I end up 
> with only months 1-12 as my column headings when I really want them to read 
> left to right in chronological order Jan 2006, Feb 2006 ...... July 2008.
> 
> TIA
date: Fri, 4 Jul 2008 05:29:01 -0700   author:   scubadiver

RE: Crosstab Date Range Problem   
Top man. Perfect fix.

"scubadiver" wrote:

> 
> If you use month number in isolation then it will compile the months from 
> each year. You haven't stated your set up but I would probably use
> 
> expr1: format([sales date], "mm-yy")
> 
> 
> 
> "Al" wrote:
> 
> > Hi hope someone can help with an annoying crosstab problem.
> > 
> > I have set up a crosstab query to show sales qty to each customer, by month, 
> > over a consecutive period January 2006-July 2008. I use the DatePart function 
> > to look at the sales date and get the month number. The problem is when I run 
> > my query it sums April 2006 sales with April 2007 sales and April 2008 sales 
> > etc because it sees them all as month 4 irrespective of year. So I end up 
> > with only months 1-12 as my column headings when I really want them to read 
> > left to right in chronological order Jan 2006, Feb 2006 ...... July 2008.
> > 
> > TIA
date: Fri, 4 Jul 2008 06:26:00 -0700   author:   Al

Re: Crosstab Date Range Problem   
Or if you want the months in chronological order instead of April 2005 
next to April 2006, use the format

Format([Sales Date], "yyyy mm")



'====================================================
  John Spencer
  Access MVP 2002-2005, 2007-2008
  The Hilltop Institute
  University of Maryland Baltimore County
'====================================================


scubadiver wrote:
> If you use month number in isolation then it will compile the months from 
> each year. You haven't stated your set up but I would probably use
> 
> expr1: format([sales date], "mm-yy")
> 
> 
> 
> "Al" wrote:
> 
>> Hi hope someone can help with an annoying crosstab problem.
>>
>> I have set up a crosstab query to show sales qty to each customer, by month, 
>> over a consecutive period January 2006-July 2008. I use the DatePart function 
>> to look at the sales date and get the month number. The problem is when I run 
>> my query it sums April 2006 sales with April 2007 sales and April 2008 sales 
>> etc because it sees them all as month 4 irrespective of year. So I end up 
>> with only months 1-12 as my column headings when I really want them to read 
>> left to right in chronological order Jan 2006, Feb 2006 ...... July 2008.
>>
>> TIA
date: Fri, 04 Jul 2008 09:37:38 -0400   author:   John Spencer

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us