I am a newbie to ASP and am trying to learn.
In my ASP page I have 2 SQL Select Statements.
I am passing a value (4+)that is stored in my (SubRs "Class")recordset to the 2nd SQL statement, but I want to extract only the first character and then add a wildcard. So that I can extract all (4%)"Class 4-, 4, and 4+) Can I do that on the fly or do I need to extract the value and assign it to a variable first to run a function on it?
----------------------------------------------
<%
Dim objConn, SubRs, FirstPullRs
Set objConn = GetConnection()
Set SubRs = Server.CreateObject("ADODB.Recordset")
Set FirstPullRs = Server.CreateObject("ADODB.Recordset")
Set objFSO = Server.CreateObject ("Scripting.FileSystemObject")
subSQL = "SELECT Class, FROM VIEW_TABLE WHERE PROPID = '" & Request("propid") & "'"
SubRs.Open subSQL, objConn,1,1
FirstPullSQL = "SELECT PropId,Class FROM VIEW_TABLE WHERE PROPID <> '" & SubRs("PropId") & "' and Class like '" & SubRs(LEFT("Class",1,"%"))& "'"
FirstPullRs.Open FirstPullSQL, objConn,1,1
%>
In my ASP page I have 2 SQL Select Statements.
I am passing a value (4+)that is stored in my (SubRs "Class")recordset to the 2nd SQL statement, but I want to extract only the first character and then add a wildcard. So that I can extract all (4%)"Class 4-, 4, and 4+) Can I do that on the fly or do I need to extract the value and assign it to a variable first to run a function on it?
----------------------------------------------
<%
Dim objConn, SubRs, FirstPullRs
Set objConn = GetConnection()
Set SubRs = Server.CreateObject("ADODB.Recordset")
Set FirstPullRs = Server.CreateObject("ADODB.Recordset")
Set objFSO = Server.CreateObject ("Scripting.FileSystemObject")
subSQL = "SELECT Class, FROM VIEW_TABLE WHERE PROPID = '" & Request("propid") & "'"
SubRs.Open subSQL, objConn,1,1
FirstPullSQL = "SELECT PropId,Class FROM VIEW_TABLE WHERE PROPID <> '" & SubRs("PropId") & "' and Class like '" & SubRs(LEFT("Class",1,"%"))& "'"
FirstPullRs.Open FirstPullSQL, objConn,1,1
%>