View Single Post
  #3  
Old July 8th, 2008, 08:26 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default crosstab query question

Use this query, changing the table name and adding your criteria for the set
of dates --
SELECT ragtopcaddy.Threshold AS [1st KO Threshold], ragtopcaddy.Start AS
[1st KO Start], ragtopcaddy.End AS [1st KO End], ragtopcaddy_1.Threshold AS
[2nd KO Threshold], ragtopcaddy_1.Start AS [2nd KO Start], ragtopcaddy_1.End
AS [2nd KO End]
FROM ragtopcaddy INNER JOIN ragtopcaddy AS ragtopcaddy_1 ON
ragtopcaddy.[Store #] = ragtopcaddy_1.[Store #]
WHERE (((ragtopcaddy_1.[KO#])=[ragtopcaddy].[KO#]+1));

--
KARL DEWEY
Build a little - Test a little


"ragtopcaddy via AccessMonster.com" wrote:

Store # KO# Threshold Start End
1019 1 $2,025,000.00 5/1/2007 4/30/2008
1019 2 $2,025,000.00 5/1/2008 4/30/2009
1019 3 $2,025,000.00 5/1/2010 4/30/2011

This is an example of some data in an Access table that I have to report to a
spreadsheet.

The spreadsheet has columns:

1st KO Threshold 1st KO Start 1st KO End 2nd KO Threshold 2nd KO
Start 2nd KO End

for each store reported to the spreadsheet.

As you can see, only 2 of the store records may be reported, and we would
like to take the 1st 2 records that fall between a set of dates. In this
instance KO#'s 2 and 3 satisfy the criteria.

How can I pivot this data in a crosstab query based on a query that returns
KO#s 2 and 3, such that it will correspond to my columns in the spreadsheet
template?

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1