Re: Use crosstab column heading in a calculation
- From: "Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 19:00:57 -0600
You must always define the data type of all parameters in crosstab queries.
Select Query->Parameters and enter
[Forms]![frmSwaps]![txtSwapID] datatype
BTW: without reading all your other postings, the solution for your first
posting is to create a query with this sql
TRANSFORM
First([tblSwapParameters].[SpotMonth]*[tblSwapParameters_1].[SpotMonth]) AS
Expr1
SELECT tblSwapParameters.SpotMonth
FROM tblSwapParameters, tblSwapParameters AS tblSwapParameters_1
GROUP BY tblSwapParameters.SpotMonth
PIVOT tblSwapParameters_1.SpotMonth;
--
Duane Hookom
MS Access MVP
--
"Bill R via AccessMonster.com" <u9289@uwe> wrote in message
news:5a83cfa40ea4a@xxxxxx
> PS:
>
> The main form is open in form view and qryParameters runs perfectly using
> the
> same criteria. But any crosstab query I design, whether it uses it's own
> criteria or uses a query that contains the criteria, generates the same
> "...
> does not recognize..." msg.
>
> Bill R wrote:
>>OK, Plan "H":
>>
>>I am now trying to create a temp table based on the crosstab query as
>>follows:
>>
>>TRANSFORM Sum(SpotMonth) AS CalcMonth
>>SELECT SpotMonth, Float, sigma
>>FROM tblSwapParameters
>>WHERE swapid=[Forms]![frmSwaps]![txtSwapID]
>>GROUP BY SpotMonth, Float, sigma
>>PIVOT SpotMonth;
>>
>>I want to save this query as "qryMatrix" and use it in a query called
>>"qryMakeTblMatrix". However, when I run the above crosstab query, I get
>>the
>>following msg:
>>"the Microsoft Jet Engine does not recognize
>>'[Forms]![frmSwaps]![txtSwapID]'
>>as a valid field name or expression"
>>I was trying to do this in a slightly different scenario, using
>>qryParameters
>>which filtered tblSwapParemeters using the same criteria. qryParameters
>>ran
>>just fine and delivered a recordset based on the control txtSwapID on the
>>main form. However, when I ran a crosstab query as above, except using
>>qryParameters and leaving out the WHERE clause, I got the same msg. The
>>above
>>query was a vain attempt to get the records more directly.
>>
>>Any suggestions would be deeply appreciated.
>>
>>>First you need to check the help and see if a crosstab will handle 145
>>>columns.
>>>
>>[quoted text clipped - 7 lines]
>>>>
>>>> Bill
>>
>
> --
> Bill Reed
>
> "If you can't laugh at yoursel, laugh at somebody else"
>
> Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Re: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Re: Use crosstab column heading in a calculation
- References:
- Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- RE: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- RE: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Use crosstab column heading in a calculation
- Prev by Date: SQL Query view behaving strangely
- Next by Date: Re: Concatenate multiple matches into single field?
- Previous by thread: RE: Use crosstab column heading in a calculation
- Next by thread: Re: Use crosstab column heading in a calculation
- Index(es):
Relevant Pages
|