Click to See Complete Forum and Search --> : Sql Count


rtatnell
03-22-2003, 01:32 PM
Hi, how do I use the SQL SELECT statement with the COUNT part?
I want to use response.write to write the amount of times a name occurs in my table. How can I do this, example code please (easier for me to understand!)

Many thanks

Ribeyed
03-22-2003, 01:36 PM
hi,



sql = "SELECT COUNT(tblTableName.fieldName) FROM tblTableName "

rtatnell
03-22-2003, 02:53 PM
I know what the SQL code is, my problem is using it with response.write to write the count that the sql statement produces. I want to run the sql to get the count, then write this count to my html code. How do i do this?

Thanks

Ribeyed
03-22-2003, 03:02 PM
hi,
You can write this many ways, so here is 1 way using least amount of code:


<%=RecordSet(0)%>

rtatnell
03-22-2003, 05:41 PM
many thanks, thats done the trick!