Link to home
Start Free TrialLog in
Avatar of korthof
korthof

asked on

Complex SQL Math Statement

I need help deriving a sql statement that can select a specific criteria from my database.

<%
Set Con = Server.CreateObject("ADODB.Connection")
Con.Open Application("DSN_Pipeline")

Set catRS2 = Server.CreateObject( "ADODB.Recordset" )
catRS2.Open "SELECT * FROM AllJobTbl", Con

sqlString = "SELECT CASE CurrentValue WHEN 0 THEN 0 ELSE (Balance / CurrentValue) END AS column_alias FROM AllJobTbl"
Dim objrs
Set objrs = Con.Execute(sqlString)
%>

I need All Balance / Current Value to display those that are <= .65

also where "Credit" = "Fair" or "Poor"

WHERE "State" = AL, CA

And I need it to response a viewable table back to an asp page.
I cant seem to understand how to prevent buffer overflow on response.
ASKER CERTIFIED SOLUTION
Avatar of nigelrivett
nigelrivett

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nigelrivett
nigelrivett

Also what datatype are the Balance, CurrentValue fields?
I assume they are decimal(x,2) otherwise you might have problems with rounding or the display format.