conditional sql statements

Discussion in 'ASP General' started by Bill, Aug 29, 2003.

  1. Bill

    Bill Guest

    I have a shopping cart that I want to load items in that come from a
    huge scrolling form. In other words, when someone clicks on a category
    in our site, it scrolls out all the items in that category, maybe 30
    or more. I have text boxes next to each item so somone can enter a
    number, then press submit form button at the bottom of the form, and
    send those slections to the shopping cart.

    The problem is, many of the text boxes are empty, yet they are still
    being sent to the shopping cart as a quatity of 0. Is there a way for
    sql to ignore a value if the variable is zero, or only get the sql
    statement to run if a variable is > 0?

    Thanks,

    Bill
     
    Bill, Aug 29, 2003
    #1
    1. Advertising

  2. Bill

    Ray at Guest

    Post your code. [empty] <> 0 unless you cint() it, or unless in your DB,
    you have a default value of 0. I don't know how your building your query,
    but it sounds like you may want to change it so that it only inserts values
    for columns that values were sent for from your form.

    Ray at work

    "Bill" <> wrote in message
    news:...
    > I have a shopping cart that I want to load items in that come from a
    > huge scrolling form. In other words, when someone clicks on a category
    > in our site, it scrolls out all the items in that category, maybe 30
    > or more. I have text boxes next to each item so somone can enter a
    > number, then press submit form button at the bottom of the form, and
    > send those slections to the shopping cart.
    >
    > The problem is, many of the text boxes are empty, yet they are still
    > being sent to the shopping cart as a quatity of 0. Is there a way for
    > sql to ignore a value if the variable is zero, or only get the sql
    > statement to run if a variable is > 0?
    >
    > Thanks,
    >
    > Bill
     
    Ray at, Aug 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neil Zanella
    Replies:
    8
    Views:
    1,208
    mfmehdi
    Oct 20, 2006
  2. Harry George
    Replies:
    6
    Views:
    417
    Bart Nessux
    Feb 23, 2004
  3. Vince
    Replies:
    12
    Views:
    762
    Martin Gregorie
    Jan 21, 2008
  4. JT
    Replies:
    1
    Views:
    124
    Bob Barrows [MVP]
    Sep 27, 2005
  5. John Crichton
    Replies:
    6
    Views:
    271
    John Crichton
    Jul 12, 2010
Loading...

Share This Page