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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display results from SQL query in text box

Status
Not open for further replies.

leppyk

MIS
Joined
Mar 24, 2005
Messages
8
Location
IE
I am tryin to display the value from this sql statement in a text box on the web page.

strSQL = "select sum(POVal1) from projects where project_code = '12345'"
objRst.Open strSQL,objConn,adOpenStatic
objRst.Close

However when i look at the text box it contains the select statement instead of the value of the select statement.

<td width="0" valign="top">
<p> <h2><strong><font size=3 color=mediumslateblue>&nbsp;Project
Registration Products Table</font></STRONG>
</h2> <p>PO Value <input type="text" name="POTotal" size="20" value="<%=strSQL%>"></p>

I am only a beginner but does anyone have any idea what i'm doing wrong?
 
Code:
strSQL = "select sum(POVal1) as valSum from projects where project_code = '12345'"
objRst.Open strSQL,objConn,adOpenStatic
strSum = objRst("valSum")
objRst.Close

<td width="0" valign="top"> 
     <p> <h2><strong><font size=3 color=mediumslateblue>&nbsp;Project
     Registration Products Table</font></STRONG>
     </h2> <p>PO Value <input type="text" name="POTotal" size="20" value="<%=strSum%>"></p>

_______
I love small animals, especially with a good brown gravy....
 
Thank you so much that has worked perfecly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top