#1
  1. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    797
    Rep Power
    35

    if then statement help


    I have a submit form that inserts the date if a date has not already been inserted, as follows:


    if ABC = "1" then
    if isnull(ABC) or ABC < " " then
    objconn.Execute("update TableName set ABC = '" & DATE & "' where id = "& id &"")
    end if
    end if

    I would like NOT to insert a new date if the date has already been inserted if the submit form is used again.

    Meaning, I want the first date to be the date in the field.

    If I change ABC = " " then, then nothing gets inserted, even from the original post. I tried a couple of elseif's and can't get anything to work.

    Appreciate you help.
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,665
    Rep Power
    285
    So you need to check id record already in database...
    and if not insert one...
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    797
    Rep Power
    35
    Doesn't this check for that? (ABC is the field that I don't wont to write to if already has something in it.

    if isnull(ABC) or ABC < " " then

    Thanks for your help, I appreciate it.

Similar Threads

  1. Using IF statement INSIDE a SELECT statement
    By K_Snyder in forum Microsoft SQL Server
    Replies: 2
    Last Post: June 10th, 2009, 01:47 PM
  2. Replies: 8
    Last Post: September 28th, 2006, 09:58 PM
  3. Nested IF statement inside DB statement
    By bazzanoid in forum ASP Development
    Replies: 27
    Last Post: April 25th, 2006, 06:14 AM
  4. Distinct statement then by variable in one statement
    By Phoenix_riser in forum ASP Development
    Replies: 0
    Last Post: April 18th, 2006, 08:17 AM
  5. Replies: 7
    Last Post: March 21st, 2005, 09:58 AM

IMN logo majestic logo threadwatch logo seochat tools logo