Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT COUNT(*) ?

Status
Not open for further replies.

other3

Programmer
Jul 30, 2002
92
US
I'm using this command where I know there is one Artist. Even in cases of multiple occurances of the Artist in the Songs table.

cmdCount.CommandText = "SELECT COUNT(*) FROM Songs " _
& "WHERE Artist = @strArtist"

When I execute the following

iArtistCount = cmdCount.ExecuteScalar

I get 0 in the case of a single occurance of an Artist and a value = to 1 less than the actual number of occurance where there are multiple occurances of an Artist.

Has anyone seen this type of thing before?


Everything I know I learned from The Grateful Dead and Buffy The Vampire Slayer
Charlie
 
Never mind, I was selecting from the wrong table. Guess the GD and BTVS didn't teach me much.

Everything I know I learned from The Grateful Dead and Buffy The Vampire Slayer
Charlie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top