[thelist] SQL Query Help after upgrade from Access

Joshua Olson joshua at waetech.com
Mon Sep 13 16:05:36 CDT 2004

> -----Original Message-----
> From: Michael Pack
> Sent: Monday, September 13, 2004 4:46 PM
> Hi all, I'm using ADO and SQL Server 2000. I'm upgrading an application
> from Access to SQL and ran into a problem with no error response.
> What worked against an Access database:
> strSelCount = "SELECT count(gender)/" & strRecCount & " as GenderCnt
> FROM facttbl WHERE gender = 'female'"
> set rs = cn.Execute(strSelCount)
> Response.Write("Females: " & FormatPercent(rs("GenderCnt")) & vbcrlf )
> I cannot get to work against the SQL database, it's returning 0 with no
> errors....


I would presume that since you are getting 0 back as the answer, that your
conditional statement (which is WHERE gender = 'male') is causing all rows
to be excluded.  Perhaps cAsE is an issue?

Check the values in the gender column again and make sure they are EXACTLY
"male" and not "MALE", or "Male", or 0, or 1, or something.

Depending on how you have the database/table configured, it may be case

Hope this helps,

Joshua Olson
Web Application Engineer
WAE Tech Inc.

More information about the thelist mailing list