Solved

Need help editing script

Posted on 2016-10-22
3
73 Views
Last Modified: 2016-10-22
I have this script:

if not rs.EOF then
      response.write " " & rs("pName")
      if SESSION("clientID")<>"" then response.write " (" & rs("pInStock") & ")"
end if

I need to modify it to show "In stock." if the value for & rs("pInStock") & is >0 and "Out of stock." if the value is <1.

I have am having a bit of trouble with this. Anyone want to try? Any help greatly appreciated.

Best regards,
Evert
0
Comment
Question by:EvertJor
3 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 41855278
if not rs.EOF then
      response.write " " & rs("pName") 
      if SESSION("clientID")<>"" then
        stock =  rs("pInStock")
        response.write " (" & stock & ") "
        if stock < 1 then
          respone.write "Out of stock"
        else
          response.write "In stock"
        end if
    end if
end if

Open in new window

0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 41855282
if not rs.EOF then
      response.write " " & rs("pName")
      InStock = "in Stock"
      If CInt( rs("pInStock")) < 1  then InStock = "out of stock"
      if SESSION("clientID")<>"" then response.write " (" & InStock & ")"
end if
0
 

Author Closing Comment

by:EvertJor
ID: 41855349
This solution worked. The other one worked only partially.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to dynamically set the form action using jQuery.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question