Please help me with sql code

A

alr7al

Hi there,



It's simple code but I got some problem with it, this is the code:-



==========



TRANSFORM Count(cars_info.ID) AS CountOfID

SELECT cars_info.[car type], Count(cars_info.ID) AS [Total Of ID]

FROM cars_info

GROUP BY cars_info.[car type]

PIVOT cars_info.site;



==========



I want to put 0 or - in the two fields which in red

And this is the picture of it in view mode:-



http://www.alr7al.net/Image1.JPG



That is all.

thanx
 
D

Duane Hookom

Try:
TRANSFORM Val(Nz(Count(cars_info.ID),0)) AS CountOfID
SELECT cars_info.[car type], Count(cars_info.ID) AS [Total Of ID]
FROM cars_info
GROUP BY cars_info.[car type]
PIVOT cars_info.site;
 
J

John Sykes

Hello,

Can someone show me the correct syntax to run a report
called "Mailing List" from a Combo box.

I also need to know what to put in "RowSource"
and "RowSource Type" sections.

Thanks in advance..

John Sykes
 

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

Similar Threads

sql to create totals 7
Nz - need code - 2
SQL Server Queries 5
crosstab or looping statement help 18
SQL Code Help 2
Complex Query Question 0
Help writing SQL query 11
does this need a loop statement? 0

Top