In a query, which function can determine if a field is exist or no

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a cross table query that return various sieves information as following:

Query1
ID Sieve_80 Sieve_35 Sieve_40.......etc
1 20 40 10

As you all know, we cannot know the number of sieve columns.
I have then another query that recuperate data in the query1. My question is
: Is there a function that determines if a column Sieve_13 is exiting? Thank
 
Sure:
DCount("[YourField]", "[YourTable]", "[SomeField]='Sieve_13'")

If you provide the SQL view of your crosstab, I could probably get you a
little closer.
 
Hi Duane,

Here is my crosstab query:
TRANSFORM First(PASSING) AS FirstPASSING
SELECT ID
FROM COURBE_GRANULOMETRIQUE
GROUP BY ID
PIVOT DIAMETER;

The crosstab query return data as following:
ID 0_008 0_10 0_40
1 50 70 100

In fact the problem is the name of the diameter column start always with a
numeric character (0_008, 0_10, 0_40). I have another program that read the
crosstab query and it return an erreur message when column name start with a
number character. For that reason, I want to build another query that read
crosstab query then rename the column. However, the problem is I have to know
if the 0_008, 0_10 and 0_40 column is present in the crosstab query or not.

"Duane Hookom" a écrit :
Sure:
DCount("[YourField]", "[YourTable]", "[SomeField]='Sieve_13'")

If you provide the SQL view of your crosstab, I could probably get you a
little closer.
--
Duane Hookom
MS Access MVP
--

MadeleineP said:
I have a cross table query that return various sieves information as
following:

Query1
ID Sieve_80 Sieve_35 Sieve_40.......etc
1 20 40 10

As you all know, we cannot know the number of sieve columns.
I have then another query that recuperate data in the query1. My question
is
: Is there a function that determines if a column Sieve_13 is exiting?
Thank
 
DCount("[DIAMETER]", "[COURBE_GRANULOMETRIQUE]", "[DIAMETER]='Sieve_13'")
If the above expression returns 0 then their are no records in the
table/query with that diameter so their will be no column.

Maybe you should explain why you think you need this function?

--
Duane Hookom
MS Access MVP


MadeleineP said:
Hi Duane,

Here is my crosstab query:
TRANSFORM First(PASSING) AS FirstPASSING
SELECT ID
FROM COURBE_GRANULOMETRIQUE
GROUP BY ID
PIVOT DIAMETER;

The crosstab query return data as following:
ID 0_008 0_10 0_40
1 50 70 100

In fact the problem is the name of the diameter column start always with a
numeric character (0_008, 0_10, 0_40). I have another program that read
the
crosstab query and it return an erreur message when column name start with
a
number character. For that reason, I want to build another query that read
crosstab query then rename the column. However, the problem is I have to
know
if the 0_008, 0_10 and 0_40 column is present in the crosstab query or
not.

"Duane Hookom" a écrit :
Sure:
DCount("[YourField]", "[YourTable]", "[SomeField]='Sieve_13'")

If you provide the SQL view of your crosstab, I could probably get you a
little closer.
--
Duane Hookom
MS Access MVP
--

MadeleineP said:
I have a cross table query that return various sieves information as
following:

Query1
ID Sieve_80 Sieve_35 Sieve_40.......etc
1 20 40 10

As you all know, we cannot know the number of sieve columns.
I have then another query that recuperate data in the query1. My
question
is
: Is there a function that determines if a column Sieve_13 is exiting?
Thank
 
Hi Duane,

I cannot read data in COURBE_GRANULOMETRIQUE because either ID 1 or ID 2 can
have the sieve 13 as follow:

ID 0_008 0_10 0_40
1 50 70 100
2 50 70 100

"Duane Hookom" a écrit :
DCount("[DIAMETER]", "[COURBE_GRANULOMETRIQUE]", "[DIAMETER]='Sieve_13'")
If the above expression returns 0 then their are no records in the
table/query with that diameter so their will be no column.

Maybe you should explain why you think you need this function?

--
Duane Hookom
MS Access MVP


MadeleineP said:
Hi Duane,

Here is my crosstab query:
TRANSFORM First(PASSING) AS FirstPASSING
SELECT ID
FROM COURBE_GRANULOMETRIQUE
GROUP BY ID
PIVOT DIAMETER;

The crosstab query return data as following:
ID 0_008 0_10 0_40
1 50 70 100

In fact the problem is the name of the diameter column start always with a
numeric character (0_008, 0_10, 0_40). I have another program that read
the
crosstab query and it return an erreur message when column name start with
a
number character. For that reason, I want to build another query that read
crosstab query then rename the column. However, the problem is I have to
know
if the 0_008, 0_10 and 0_40 column is present in the crosstab query or
not.

"Duane Hookom" a écrit :
Sure:
DCount("[YourField]", "[YourTable]", "[SomeField]='Sieve_13'")

If you provide the SQL view of your crosstab, I could probably get you a
little closer.
--
Duane Hookom
MS Access MVP
--

I have a cross table query that return various sieves information as
following:

Query1
ID Sieve_80 Sieve_35 Sieve_40.......etc
1 20 40 10

As you all know, we cannot know the number of sieve columns.
I have then another query that recuperate data in the query1. My
question
is
: Is there a function that determines if a column Sieve_13 is exiting?
Thank
 
Then try
DCount("[DIAMETER]", "[COURBE_GRANULOMETRIQUE]", "[DIAMETER]='Sieve_13' AND
ID=1")


--
Duane Hookom
MS Access MVP


MadeleineP said:
Hi Duane,

I cannot read data in COURBE_GRANULOMETRIQUE because either ID 1 or ID 2
can
have the sieve 13 as follow:

ID 0_008 0_10 0_40
1 50 70 100
2 50 70 100

"Duane Hookom" a écrit :
DCount("[DIAMETER]", "[COURBE_GRANULOMETRIQUE]", "[DIAMETER]='Sieve_13'")
If the above expression returns 0 then their are no records in the
table/query with that diameter so their will be no column.

Maybe you should explain why you think you need this function?

--
Duane Hookom
MS Access MVP


MadeleineP said:
Hi Duane,

Here is my crosstab query:
TRANSFORM First(PASSING) AS FirstPASSING
SELECT ID
FROM COURBE_GRANULOMETRIQUE
GROUP BY ID
PIVOT DIAMETER;

The crosstab query return data as following:
ID 0_008 0_10 0_40
1 50 70 100

In fact the problem is the name of the diameter column start always
with a
numeric character (0_008, 0_10, 0_40). I have another program that read
the
crosstab query and it return an erreur message when column name start
with
a
number character. For that reason, I want to build another query that
read
crosstab query then rename the column. However, the problem is I have
to
know
if the 0_008, 0_10 and 0_40 column is present in the crosstab query or
not.

"Duane Hookom" a écrit :

Sure:
DCount("[YourField]", "[YourTable]", "[SomeField]='Sieve_13'")

If you provide the SQL view of your crosstab, I could probably get you
a
little closer.
--
Duane Hookom
MS Access MVP
--

I have a cross table query that return various sieves information as
following:

Query1
ID Sieve_80 Sieve_35 Sieve_40.......etc
1 20 40 10

As you all know, we cannot know the number of sieve columns.
I have then another query that recuperate data in the query1. My
question
is
: Is there a function that determines if a column Sieve_13 is
exiting?
Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top