PC Review


Reply
Thread Tools Rate Thread

Crosstab query - odd field

 
 
SusanV
Guest
Posts: n/a
 
      19th Sep 2005
Hi all,

I have 2 stored Crosstab queries which are basically the same in structure
but which pull data from different sources:

qryXtab_tblTemp:

TRANSFORM Last(tblTemp.Freq) AS LastOfFreq
SELECT tblTemp.Equipment AS Expr1, tblTemp.HSC AS Expr2, tblTemp.Match AS
Expr3
FROM tblTemp
WHERE ((([tblTemp].[OpStat])="FOS"))
GROUP BY tblTemp.Equipment, tblTemp.HSC, tblTemp.Match
ORDER BY tblTemp.HSC
PIVOT tblTemp.MCode;



qryXtab_Prop:

TRANSFORM Last(tblPTemp.FREQ) AS LastOfFREQ
SELECT tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
FROM tblPTemp
GROUP BY tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
ORDER BY tblPTemp.HSC
PIVOT tblPTemp.MCODE;

The second query, qryXtab_Prop outputs an additional field labeled <> (which
never has any data, all records are null for this field). The thing is, I
don't understand where it's coming from. I've rebuilt the query several
times, and also rebuilt the first query using the exact same methods, and
the first query never outputs this <> field, but the second always does.

It's not important functionally, as I can omit this weird <> field when
working further with the data, but I'm very curious as to why it's there and
what significance it may have?

Thanks,

Susan


 
Reply With Quote
 
 
 
 
Duane Hookom
Guest
Posts: n/a
 
      19th Sep 2005
You have a record in tblPTemp with no value in the MCODE field. Delete the
record or add a where clause to filter out records
WHERE [tblTemp].[OpStat]="FOS" And MCODE Is Not Null

--
Duane Hookom
MS Access MVP
--

"SusanV" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> I have 2 stored Crosstab queries which are basically the same in structure
> but which pull data from different sources:
>
> qryXtab_tblTemp:
>
> TRANSFORM Last(tblTemp.Freq) AS LastOfFreq
> SELECT tblTemp.Equipment AS Expr1, tblTemp.HSC AS Expr2, tblTemp.Match AS
> Expr3
> FROM tblTemp
> WHERE ((([tblTemp].[OpStat])="FOS"))
> GROUP BY tblTemp.Equipment, tblTemp.HSC, tblTemp.Match
> ORDER BY tblTemp.HSC
> PIVOT tblTemp.MCode;
>
>
>
> qryXtab_Prop:
>
> TRANSFORM Last(tblPTemp.FREQ) AS LastOfFREQ
> SELECT tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
> tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
> FROM tblPTemp
> GROUP BY tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
> tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
> ORDER BY tblPTemp.HSC
> PIVOT tblPTemp.MCODE;
>
> The second query, qryXtab_Prop outputs an additional field labeled <>
> (which never has any data, all records are null for this field). The thing
> is, I don't understand where it's coming from. I've rebuilt the query
> several times, and also rebuilt the first query using the exact same
> methods, and the first query never outputs this <> field, but the second
> always does.
>
> It's not important functionally, as I can omit this weird <> field when
> working further with the data, but I'm very curious as to why it's there
> and what significance it may have?
>
> Thanks,
>
> Susan
>



 
Reply With Quote
 
SusanV
Guest
Posts: n/a
 
      19th Sep 2005
Good morning Duane - and thanks for responding so quickly!

Crosstab queries are still a novelty here, and your explanation makes
PERFECT sense! Yes, I have several records with no MCode values (expected to
be so, as well) - and I can't drop those records - I need them to populate
the RowHeading fields. So this is working perfectly - and I can simply
delete the <> field later via DAO...

Beautiful - thank you SO much!!! ;-D

Susan


"Duane Hookom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You have a record in tblPTemp with no value in the MCODE field. Delete the
> record or add a where clause to filter out records
> WHERE [tblTemp].[OpStat]="FOS" And MCODE Is Not Null
>
> --
> Duane Hookom
> MS Access MVP
> --
>
> "SusanV" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi all,
>>
>> I have 2 stored Crosstab queries which are basically the same in
>> structure but which pull data from different sources:
>>
>> qryXtab_tblTemp:
>>
>> TRANSFORM Last(tblTemp.Freq) AS LastOfFreq
>> SELECT tblTemp.Equipment AS Expr1, tblTemp.HSC AS Expr2, tblTemp.Match AS
>> Expr3
>> FROM tblTemp
>> WHERE ((([tblTemp].[OpStat])="FOS"))
>> GROUP BY tblTemp.Equipment, tblTemp.HSC, tblTemp.Match
>> ORDER BY tblTemp.HSC
>> PIVOT tblTemp.MCode;
>>
>>
>>
>> qryXtab_Prop:
>>
>> TRANSFORM Last(tblPTemp.FREQ) AS LastOfFREQ
>> SELECT tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
>> tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
>> FROM tblPTemp
>> GROUP BY tblPTemp.Equipment, tblPTemp.HSC, tblPTemp.Match,
>> tblPTemp.CalculatedLevelCode, tblPTemp.MaintenancePlanId
>> ORDER BY tblPTemp.HSC
>> PIVOT tblPTemp.MCODE;
>>
>> The second query, qryXtab_Prop outputs an additional field labeled <>
>> (which never has any data, all records are null for this field). The
>> thing is, I don't understand where it's coming from. I've rebuilt the
>> query several times, and also rebuilt the first query using the exact
>> same methods, and the first query never outputs this <> field, but the
>> second always does.
>>
>> It's not important functionally, as I can omit this weird <> field when
>> working further with the data, but I'm very curious as to why it's there
>> and what significance it may have?
>>
>> Thanks,
>>
>> Susan
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crosstab query is no longer crosstab when I include field (in repo Ben8765 Microsoft Access Reports 1 15th Oct 2009 10:01 PM
Missing Row Field in Crosstab Query Bart Microsoft Access Queries 0 10th Feb 2009 06:28 AM
Sum of a field from Crosstab Query DZ Microsoft Access VBA Modules 2 9th Jul 2008 04:18 AM
Sum Calculated Field in Crosstab Query =?Utf-8?B?SmVyaQ==?= Microsoft Access Queries 4 25th Jul 2007 01:18 AM
Re: Crosstab Query does not recognize field name MGFoster Microsoft Access Queries 3 5th May 2004 08:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:08 PM.