p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Why can't use select count


Message #1 by "Raymond" <jmanking@h...> on Wed, 26 Jul 2000 3:4:6
MY SQL string is here : 

"select RECORD_ID, COUNT (RECORD_ID) RECORD_IDCOUNT from ProposedEvent 

where TABLE = '" & table & "' group by RECORD_ID"



And I try to use Response.Wrtie recordset("RECORD_IDCOUNT") to return the 

number of count in the recordset



But there is a syntax error showing below :

Syntax error (missing operator) in query expression 'COUNT (RECORD_ID) 

RECORD_IDCOUNT'.



Anyone can help! Thanks so much!



Message #2 by "Richard Bukovansky" <richard.bukovansky@c...> on Wed, 26 Jul 2000 10:52:04 +0200
Easy, use COUNT (RECORD_ID) AS RECORD_IDCOUNT...



Regards



Richard Bukovansky

----- Original Message -----

From: "Raymond" <>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, July 26, 2000 12:00 AM

Subject: [asp_databases] Why can't use select count





> MY SQL string is here :

> "select RECORD_ID, COUNT (RECORD_ID) RECORD_IDCOUNT from ProposedEvent

> where TABLE = '" & table & "' group by RECORD_ID"

>

> And I try to use Response.Wrtie recordset("RECORD_IDCOUNT") to return the

> number of count in the recordset

>

> But there is a syntax error showing below :

> Syntax error (missing operator) in query expression 'COUNT (RECORD_ID)

> RECORD_IDCOUNT'.

>

> Anyone can help! Thanks so much!

>

>

Message #3 by Imar Spaanjaars <Imar@c...> on Wed, 26 Jul 2000 10:48:37 +0200
If you do a SELECT COUNT, you can't select anything else. Count will only 

return one record.



So try this



         "select COUNT (RECORD_ID) from ProposedEvent where TABLE = '" & table



Imar





At 03:04 AM 7/26/2000 +0000, you wrote:

>MY SQL string is here :

>"select RECORD_ID, COUNT (RECORD_ID) RECORD_IDCOUNT from ProposedEvent

>where TABLE = '" & table & "' group by RECORD_ID"

>

>And I try to use Response.Wrtie recordset("RECORD_IDCOUNT") to return the

>number of count in the recordset

>

>But there is a syntax error showing below :

>Syntax error (missing operator) in query expression 'COUNT (RECORD_ID)

>RECORD_IDCOUNT'.

>

>Anyone can help! Thanks so much!

>

>

Message #4 by pradeep francis <pradeep_pf@y...> on Wed, 26 Jul 2000 08:07:48 -0700 (PDT)
hi raymond

try this one

   syntax

select COUNT (RECORD_ID) RECORD_IDCOUNT from

ProposedEvent 

where TABLE = '" & table & "' group by RECORD_ID"

                 Pradeep

--- Raymond wrote:

> MY SQL string is here : 

> "select RECORD_ID, COUNT (RECORD_ID) RECORD_IDCOUNT

> from ProposedEvent 

> where TABLE = '" & table & "' group by RECORD_ID"

> 

> And I try to use Response.Wrtie

> recordset("RECORD_IDCOUNT") to return the 

> number of count in the recordset

> 

> But there is a syntax error showing below :

> Syntax error (missing operator) in query expression

> 'COUNT (RECORD_ID) 

> RECORD_IDCOUNT'.

> 

> Anyone can help! Thanks so much!

> 

> 


  Return to Index