QUERYS

G

GILBERT

HOW DO I INSERT A COL IN A QUERY THAT WILL GIVE THE TOTAL OF A SPECFIC COL
FOR EX: THERE ARE 20 ENTRIES IN A QUERY I WANT TO SHOW THE NUMBER 20 IN EACH
ROW OR COL B HAS 5YES PROVIDE SUM OF YES IN COL C I DON'T WANT TO USE THE
TOTAL BUTTON. I NEED THE TOTAL NUMBER TO BE IN THE QUERY NOT IN THE REPORT.
 
U

user

This query uses the DCount function so display the count of records (whose
field "Value" starts with the letter "c") in itself as an another column on
each record.

SELECT tblValues.Value, DCount("[Value]","qryShowTotalFound") AS [Found]
FROM tblValues
WHERE (((tblValues.Value) Like "c*"));

If you change the criteria, you have to save the query for it to redo the
count.

Doug


GILBERT said:
HOW DO I INSERT A COL IN A QUERY THAT WILL GIVE THE TOTAL OF A SPECFIC COL
FOR EX: THERE ARE 20 ENTRIES IN A QUERY I WANT TO SHOW THE NUMBER 20 IN EACH
ROW OR COL B HAS 5YES PROVIDE SUM OF YES IN COL C I DON'T WANT TO USE THE
TOTAL BUTTON. I NEED THE TOTAL NUMBER TO BE IN THE QUERY NOT IN THE
REPORT.
 
G

GILBERT

I'm getting and error I'm missing a [ or) and here is the expr
EXP1:(SELECT r1.atty,DCount("[atty]","(qryShowTotalFound") AS
[Found]FROMr1WHERE(((r1.atty) Like "5*"));
R1= is name of table and query
atty= is the name of the field
5= is the criteria I'm using numbers but I will use text also
Where am I wrong
user said:
This query uses the DCount function so display the count of records (whose
field "Value" starts with the letter "c") in itself as an another column on
each record.

SELECT tblValues.Value, DCount("[Value]","qryShowTotalFound") AS [Found]
FROM tblValues
WHERE (((tblValues.Value) Like "c*"));

If you change the criteria, you have to save the query for it to redo the
count.

Doug


GILBERT said:
HOW DO I INSERT A COL IN A QUERY THAT WILL GIVE THE TOTAL OF A SPECFIC COL
FOR EX: THERE ARE 20 ENTRIES IN A QUERY I WANT TO SHOW THE NUMBER 20 IN EACH
ROW OR COL B HAS 5YES PROVIDE SUM OF YES IN COL C I DON'T WANT TO USE THE
TOTAL BUTTON. I NEED THE TOTAL NUMBER TO BE IN THE QUERY NOT IN THE
REPORT.
 
U

user

It looks like there are a couple of more "(" than ")"

try

EXP1: SELECT r1.atty, DCount("[atty]","qryShowTotalFound") AS
[Found] FROM r1 WHERE ((r1.atty) Like "5*");

Doug

GILBERT said:
I'm getting and error I'm missing a [ or) and here is the expr
EXP1:(SELECT r1.atty,DCount("[atty]","(qryShowTotalFound") AS
[Found]FROMr1WHERE(((r1.atty) Like "5*"));
R1= is name of table and query
atty= is the name of the field
5= is the criteria I'm using numbers but I will use text also
Where am I wrong
user said:
This query uses the DCount function so display the count of records (whose
field "Value" starts with the letter "c") in itself as an another column on
each record.

SELECT tblValues.Value, DCount("[Value]","qryShowTotalFound") AS [Found]
FROM tblValues
WHERE (((tblValues.Value) Like "c*"));

If you change the criteria, you have to save the query for it to redo the
count.

Doug


GILBERT said:
HOW DO I INSERT A COL IN A QUERY THAT WILL GIVE THE TOTAL OF A SPECFIC COL
FOR EX: THERE ARE 20 ENTRIES IN A QUERY I WANT TO SHOW THE NUMBER 20
IN
EACH
ROW OR COL B HAS 5YES PROVIDE SUM OF YES IN COL C I DON'T WANT TO USE THE
TOTAL BUTTON. I NEED THE TOTAL NUMBER TO BE IN THE QUERY NOT IN THE
REPORT.
 
G

GILBERT

Hi User,
Thanks for taking the time to help me . I 've inserted the exp in my query
and i'm getting a syntax error that states I need a ( in front of "Select"
then when I insert it. Then it request a closing ) ].


user said:
It looks like there are a couple of more "(" than ")"

try

EXP1: SELECT r1.atty, DCount("[atty]","qryShowTotalFound") AS
[Found] FROM r1 WHERE ((r1.atty) Like "5*");

Doug

GILBERT said:
I'm getting and error I'm missing a [ or) and here is the expr
EXP1:(SELECT r1.atty,DCount("[atty]","(qryShowTotalFound") AS
[Found]FROMr1WHERE(((r1.atty) Like "5*"));
R1= is name of table and query
atty= is the name of the field
5= is the criteria I'm using numbers but I will use text also
Where am I wrong
user said:
This query uses the DCount function so display the count of records (whose
field "Value" starts with the letter "c") in itself as an another column on
each record.

SELECT tblValues.Value, DCount("[Value]","qryShowTotalFound") AS [Found]
FROM tblValues
WHERE (((tblValues.Value) Like "c*"));

If you change the criteria, you have to save the query for it to redo the
count.

Doug


HOW DO I INSERT A COL IN A QUERY THAT WILL GIVE THE TOTAL OF A SPECFIC COL
FOR EX: THERE ARE 20 ENTRIES IN A QUERY I WANT TO SHOW THE NUMBER 20 IN
EACH
ROW OR COL B HAS 5YES PROVIDE SUM OF YES IN COL C I DON'T WANT TO USE THE
TOTAL BUTTON. I NEED THE TOTAL NUMBER TO BE IN THE QUERY NOT IN THE
REPORT.
 
U

user

So does it work like this...

EXP1: (SELECT r1.atty, DCount("[atty]","qryShowTotalFound") AS
[Found] FROM r1 WHERE ((r1.atty) Like "5*");)

Doug
 
Top