Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Addition of the text field numbers

Status
Not open for further replies.

Tekhelpnet

Technical User
Joined
Oct 9, 2007
Messages
63
Location
US
I have crosstab query.
2 text fields (containing numbers) are suppose to be added.
What is the syntax? I had tried about anything
=[071 ]+[080]
=SUM([071 ]+[080])
=Count([071 ]+[080])
=([071 ]+[080])
etc
Nothing works
 
If the fields are text, you will need to convert them. Val may suit:

Val(Field1)+Val(Field2)
 
If it wasn't a crosstabI guess than...
But having a crosstab how do I call field if the field is
the Column Heading USER_ID turned into:
'USERID100' OR 'USERID200'
and I am ending up with
USERID100 USERID200
10 15
and I need SUM of these fields...

Still thinking...
 
Please post the SQL and the result that you want.
 
Query:
NameID Descr
100 Good
100 Good
100 Bad
100 Bad
100 Bad
100 Ugly


Crosstab
NameID Good Bad TotalDescr
100 2 3 5

So how do I get 5? How do I add Good and Bad excluding Ugly?
O use to have Totals without exclusions but with exclusion it seem like Function needed is it?

Thanks
 
Do you mean:

Code:
TRANSFORM Count(T.NameID) AS CountOfID
SELECT T.NameID, Count(T.NameID) AS [Total Of ID]
FROM TblT T
WHERE (((T.Descr)<>"Ugly"))
GROUP BY T.NameID
PIVOT T.Descr;
 
I dunno, if this is the only way?
So will I have to insert SUB_Report just to display this values? Thanks
 
I still do not understand what you want to do! You mentioned a crosstab excluding 'ugly', but apparently that is not what you want. Have you considered DSum?

=DSum("ThisNumber","ThisTableOrQuery","ThisField='" & ThisTextVar & "'"

Or DCount?
 
I have a query:
SELECT DISTINCT
Test.RECRUITER_ID,
Test.DESCR,
Test.DESCR1
FROM
WHERE (((Test.DESCR)="Good" Or (Test.DESCR)="Bad" Or (Test.DESCR)="Ugly"

Then I had made a crosstab:
TRANSFORM Count(Test.DESCR1) AS CountOfDESCR1
SELECT Test.RECRUITER_ID, Count(Test.DESCR1) AS [Total Of DESCR1]
FROM Test
GROUP BY Test.RECRUITER_ID
PIVOT Test.DESCR;

Now I need to summarize (((Test.DESCR)="Good" Or (Test.DESCR)="Bad" per Test.RECRUITER_ID

I can have another crosstab made and insert SUB_Report but I wouldn't want IF there s another way.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top