count number of rows in table
-
can anyone tell me the sql command for counting number of entries in a table and displaying as integer in textbox
-
can anyone tell me the sql command for counting number of entries in a table and displaying as integer in textbox
-
thanks that helped a lot. can you also help me with this similar query too. i need to do the same query but search only for entries where in one of the columns there is the letter f as appose to m. but i cant use a text box to enter the f. this is what i got but gives me the same answer as 'select count(*) from tablename "Select count(*) from Pupils where Sex LIKE '%" & F & "'" cheers
-
thanks that helped a lot. can you also help me with this similar query too. i need to do the same query but search only for entries where in one of the columns there is the letter f as appose to m. but i cant use a text box to enter the f. this is what i got but gives me the same answer as 'select count(*) from tablename "Select count(*) from Pupils where Sex LIKE '%" & F & "'" cheers
actually dont worry i worked it out for myself cheers lots:)
-
thanks that helped a lot. can you also help me with this similar query too. i need to do the same query but search only for entries where in one of the columns there is the letter f as appose to m. but i cant use a text box to enter the f. this is what i got but gives me the same answer as 'select count(*) from tablename "Select count(*) from Pupils where Sex LIKE '%" & F & "'" cheers
This depends on the datatype of the "Sex" column and what data is in it. What you have will work, so long as the column is one of the character types and only contains F or M. If there are spaces in the data or other garbage that shouldn't be there, your query is going to have a difficult time picking out the correct rows. Provided the table was setup correctly and the data was validated before it was written to the table, something like this should work:
SELECT COUNT(Sex) FROM Pupils WHERE Sex='F'
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007