Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 5th, 2010, 09:20 AM
Authorized User
 
Join Date: Jun 2006
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
Default IF Statement

Okay, I'm doing something really stupid, and can't figure it out. I'm trying to write a simple IF statement in the following context:

Code:
 
  <td><font face="Verdana" size=1>
   <%
   if rsqdb("KPName") like '%cpu%' then
      response.write rsqdb("CPU")
      else
      response.write rsqdb("KPName")
      end if
      %>
  </td>
I keep getting a syntax error.

Last edited by dalezjc; November 5th, 2010 at 09:24 AM..
 
Old November 5th, 2010, 02:35 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

LIKE is a function ONLY available in SQL coding.

Code:
If InStr( 1, rsqdb("KPName", "cpu", vbTextCompare )  > 0 Then
But even better might be to do this in the SQL query. Would have to see the query to know.





Similar Threads
Thread Thread Starter Forum Replies Last Post
IF ELSE Statement webXtreme Classic ASP Basics 19 February 9th, 2007 05:56 PM
Like Statement Nitin_sharma Oracle ASP 2 May 10th, 2005 12:18 AM
Like Statement Nitin_sharma Oracle 4 February 12th, 2005 01:46 PM
With Statement aliddle General .NET 1 February 9th, 2005 09:22 AM
if statement markhardiman VS.NET 2002/2003 1 July 31st, 2003 06:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.