MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 2nd, 2004, 07:00 PM
iRead iRead is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 14 iRead User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problems with a SELECT SUM() AS statement

When I execute the code around these statements I get the error below. Any suggestions on why or ideas about a better way to a total from a column in a dataset with 3 or 4 filter conditions will be greatly appreciated.

Select SUM(amount) AS SQLTotal FROM T1 WHERE comID = 'C1' AND catID = 'C2' AND mnth = 'March' AND yr = '2004'


LableTotal.Text = SQLTotal;

Compiler Error Message: CS0103: The name 'SQLTotal' does not exist in the class or namespace 'ASP.rptTest_aspx'

Thank you!
iRead

Reply With Quote
  #2  
Old April 5th, 2004, 11:11 AM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
you should have something like this:
LableTotal.Text = Myquery.SQLTotal;

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Problems with a SELECT SUM() AS statement


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT