473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to count the data from table

Fary4u
273 100+
Hi

how to count the data ( not count the record )from the table & with the following id ?

i'm using asp classic with ado MS Access database
with simple query
"select * from order where orderid = 1"
Expand|Select|Wrap|Line Numbers
  1. orderID | Prod ID | Qnty
  2. 1  |  3  |  2
  3. 1  |  2  |  1
  4. 2  |  2  |  1
  5. 2  |  4  |  1
  6.  
for example result like this i.e ------------------
Expand|Select|Wrap|Line Numbers
  1. orderID | Qnty
  2. 1  |  3
  3.  
  4. you got 3 record 
  5.  
Jun 25 '10 #1
4 2070
Select count(*) from order where orderid = 1
Jun 25 '10 #2
Fary4u
273 100+
@viktorka
SELECT count(Qnty) As Count from order WHERE orderid = 1
Jun 28 '10 #3
I would not recommend using Count as a name of as column. SQL may not generate an error, however, later you may get confused where is a function call and where a column name. In this case you have to use it in the brackets
SELECT count(Qnty) As [Count] from order WHERE orderid = 1
Jun 28 '10 #4
Fary4u
273 100+
@viktorka
Hi viktorka

thanks for reply actually this query work fine me
SELECT count(Qnty) As [Count] from order WHERE orderid = 1

i though i'll share with you :)

coz i'm particular looking count the Qnty this is why i just draw my table structure

thanks anyway for you help :)
Jun 28 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sunny076 | last post by:
Hi, I am wondering if anyone can enlighten me on how to get the number/count of table in a database using SQL query. I know I can see the number of table using "Show Tables" in MySQL Syntax but...
1
by: Kevin Myers | last post by:
Hello, I'm an experienced application developer in some languages (including various SQL dialects), but have very little experience with MS Access or VBA, and am having trouble figuring out how...
2
by: Steve Stover | last post by:
I want to use the caching API in .net to store data. The data would be stored in a data table class that has approx. 10 columns and 71 rows. What I need to know is this: According to Microsoft's...
2
by: Brian Mitchell | last post by:
Ok, I know this is an elementary question but I have a data grid that is bound to a data table and I can't seem to find a way to match the selected row in the grid with it's respective row in the...
1
by: Vasilis X | last post by:
Here is the question : I have a data table, UnShorted, which has a data column EventTime (type : date time) and a data column Values (type : single). I want to create a table, Shorted, that...
1
by: John | last post by:
Hi When using Table Adapter Configuration Wizard if 'Use SQL Statements' is selected as Command Type, the data table's name in dataset is retained and only its data adapter's select statements...
5
by: Daniel Wetzler | last post by:
Dear MS SQL Experts, I have to get the number of datasets within several tables in my MSSQL 2000 SP4 database. Beyond these tables is one table with about 13 million entries. If I perform a...
2
by: db2udbgirl | last post by:
If I perform a select count(*) from tred.order_delivery query will it internally perform a full table scan to determine the row count for the following scenario case 1: There is a primary key on a...
1
by: DH | last post by:
I have an untyped dataset with a table. I am trying to programmatically add a row to this table. This was working in VS 2003 / .net 1.1 I am receiving an error "Object reference not set to an...
1
by: laredotornado | last post by:
Hi, I have a data table on my page (buried amidst other images and extraneous text). I would like to spawn a new window that automatically prints the content of my data table, and only that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.