Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 02-27-2001, 04:28 PM   #1
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
I am having a problem that I know I've had before but don't know the resolution. I don't do a count of records very often within a database so it's not really fresh in my mind. Here is what I am seeing after doing a response.write of the strSQL and it producing the error...
Code:
SELECT Count(OutageID) As intRecords, OutageID FROM Outages ORDER by OutageID 
Microsoft JET Database Engine error '80040e21' 

You tried to execute a query that does not include the specified expression 'OutageID' as part of an aggregate function. 

?
Thanks for any help you can give me.
artsapimp is offline   Reply With Quote
Old 02-28-2001, 07:53 AM   #2
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Here's the deal: you aliased the count as intRecords. intRecords is the only column that will be returned by the query. That means that the ORDER BY needs to sort by intRecords.

As a note: if you would not have aliased the count (would have left out the "as intRecords"), you would still be returning one column. But it wouldn't have a name.
UncaDanno is offline   Reply With Quote
Old 02-28-2001, 02:26 PM   #3
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Thank you. I have it working now.
artsapimp is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2