473,396 Members | 1,996 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.

select count(*) from table_name not showing desired result

hello..
i have a simple table ATTENDANCE with following columns and value..

create table ATTENDANCE
(EMP_ID VARCHAR(20),
STATUS VARCHAR(10),
DATE DATETIME);

EMP_ID STATUS DATE
A1 PRESENT 2012-02-13 00:00:00.000
A2 PRESENT 2012-02-13 00:00:00.000

now my problem is when i m firing the query as:
select count(*) from ATTENDANCE where emp_id='A1' AND STATUS='PRESENT';
it is showing "1" as answer and this is correct.

but when when i m firing the query as:
select count(*) from ATTENDANCE where emp_id='A2' AND STATUS='PRESENT';
it is showing "0" as answer and this is NOT correct, IT SHOULD SHOW "1".

can anyone plz tell where i m wrong..

i m using sqlserver 2005 and windows 7 as OS..


DO REPLY SOON..
THANK U..
Feb 13 '12 #1
1 2038
got the ans..
just a silly mistake of extra space..
thank u..
Feb 13 '12 #2

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

Similar topics

2
by: Ben | last post by:
Hi, I have a problem with this query: $link = mysql_connect("localhost", "root", "pw"); $dbsel = mysql_select_db('mydb', $link); $lol='bibi'; $sql = "select count(*) as totuur from...
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...
8
by: Thomas | last post by:
Hi! I´m a newbie with this and I´m trying to build a forum of my own but have stumbled on my first problem as early as the opening page. To the problem: I want to show a simple forum layout...
3
by: auron | last post by:
Hi there, I have a really stupid and banal problem with showing the results of a MySQL query in PHP, preciselly with MySQL count() function that gives to a variable in PHP the result. NOTE:...
5
by: Karl Irvin | last post by:
In VBA, how do you see the results of an sql count statement like the following ? Select Count (*) as Total from tblCustomer Result = DoCmd.RunSql("Select Count (*) as Total from...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
2
by: John Bailo | last post by:
I imported 600,000 records from SQL Server 2005 to mySQL. I know they are in there -- I just can't see them! When I do a SELECT, it processes for a while, and then returns nothing. Same with...
5
by: FFMG | last post by:
Hi, I was running a test on a table with 50000 rows. When I do: $sql = "SELECT * FROM TABLE"; $result = mysql_query($sql); $total = mysql_num_rows(result); I get a 'run out of memory...
3
by: karpalmera | last post by:
We are trying to do select count(*) and select * from the same table. We have executed the following: when we execute SELECT COUNT(*) FROM TABLE1; the result is 0 but when we execute ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.