Go Back   Access World Forums > Apps and Windows > Visual Basic

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-07-2018, 07:58 AM   #1
rcovington
Newly Registered User
 
Join Date: Oct 2014
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
rcovington is on a distinguished road
Get a count of headers (fields) in the Select statement of a crosstab query

Is there a way to get a count of the headers (fields) that occur only in the Select statement of a crosstab query? I can get the ordinal position and name of each field in a crosstab query, yet it will be better to get a count of those fields that occur only in the Select statement.

rcovington is offline   Reply With Quote
Old 04-07-2018, 08:49 AM   #2
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,839
Thanks: 55
Thanked 2,183 Times in 2,094 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Get a count of headers (fields) in the Select statement of a crosstab query

You just create a query that counts it:

Selec count(*) from (select distinct columnfield From yourtable)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 04-07-2018, 02:35 PM   #3
rcovington
Newly Registered User
 
Join Date: Oct 2014
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
rcovington is on a distinguished road
Re: Get a count of headers (fields) in the Select statement of a crosstab query

Thanks for your quick reply arnelgp. I'm more than likely missing something about the element columnfield?

rcovington is offline   Reply With Quote
Old 04-07-2018, 05:51 PM   #4
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,839
Thanks: 55
Thanked 2,183 Times in 2,094 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Get a count of headers (fields) in the Select statement of a crosstab query

If you exam the xtsb in sql there is a portion there, Pivot. That field i am referring.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 04-07-2018, 06:32 PM   #5
rcovington
Newly Registered User
 
Join Date: Oct 2014
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
rcovington is on a distinguished road
Re: Get a count of headers (fields) in the Select statement of a crosstab query

Thank you again arnelgp. That now gives me a count of the columns (fields) in the pivot clause.

rcovington is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crosstab Query - Headers fenhow Queries 9 07-18-2016 01:51 PM
Crosstab query with two column headers foxtrot123 Queries 6 04-23-2016 08:20 AM
Returning Count value from SELECT statement Meltdown Forms 6 04-11-2010 09:33 AM
Column headers in a crosstab query. Robert Burns Modules & VBA 6 12-13-2002 06:37 AM
Headers as in a Crosstab NigeP Reports 0 06-20-2000 10:53 AM




All times are GMT -8. The time now is 08:58 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World