1. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2008
    Rep Power

    Using if statement in sqlserver 2000

    i experts i help me on using the if statement to return data from bookname if Bc is null
    here is my sql code

    SELECT Account, Regno, Types, [Date], [Names], DateTaken, Bookstaken, Booksreturned, Datereturned, Bookcode, BookName, Subject, Subjectcode,
    DESCRPTION, Class, qty2, trcode, Amount, posttime, users, recieptno, Last1, last2, attendant, author, costprice, subcategory, Classe, supplier,
    serialno, markreturned, particulars, category, sort, mark, Shelve, house, stream, retainid, duedate, mark3, Lastdate, overdues, Stock, Balance,
    Copiesreturned, BookName + ' ' + Classe AS Bc
    FROM dbo.Groupborrowing
    WHERE (Balance >= 1)
  2. #2
  3. Contributing User
    ASP Hero (2000 - 2499 posts)

    Join Date
    Nov 2003
    Rep Power

    Using if statement in sqlserver 2000

    well from your code Bc is a collection of the field
    BookName and Classe

    BUT! in the middle you have:
    + ' ' +

    so Bc will never be NULL!

    Please explain what your trying to do?
    Hope this advise helps.

    If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2009
    Rep Power
    add this statement to select and check it once
    where BookName is not null or Classe is not null

Similar Threads

  1. Create table statement syntax error in access 2000
    By ehsanking in forum Microsoft Access Help
    Replies: 1
    Last Post: August 8th, 2005, 04:12 AM
  2. Replies: 3
    Last Post: June 27th, 2005, 10:38 PM
  3. Insert images in sqlserver 2000 using asp.net
    By rsurays in forum .NET Development
    Replies: 3
    Last Post: April 24th, 2005, 09:53 PM
  4. Image from SQLServer 2000 DB -> Blank Output
    By csdstudent in forum .NET Development
    Replies: 2
    Last Post: November 21st, 2004, 09:03 AM
  5. Return value from SQLSERVER 2000
    By rkonara in forum ASP Development
    Replies: 1
    Last Post: June 7th, 2004, 11:11 AM

IMN logo majestic logo threadwatch logo seochat tools logo