SQL statement Syntax

Results 1 to 3 of 3

Thread: SQL statement Syntax

  1. #1
    Join Date
    Dec 1969

    Default SQL statement Syntax

    I&#039m trying to select all of the records from a table where payment has not been made. So I wrote the following sql statement but it doesn&#039t like the "" before the ORDER BY clause. I&#039m basically trying to say, give me all of the records where the payment type field is empty (blank or NULL). How do I write this? THanks! Here&#039s my statement:<BR>"SELECT * FROM PCSALE WHERE Location Like &#039Niagara Falls&#039 AND Payment_Type = "" ORDER BY Last_Name"

  2. #2
    Steve Cimino Guest

    Default RE: SQL statement Syntax

    Empty (blank) and NULL are two different values; make sure you treat them differently.<BR><BR>Payment_Type = &#039&#039 OR Payment_Type IS NULL<BR><BR>Notice the single quotes for the empty varchar field, not double quotes like you have.

  3. #3
    Join Date
    Dec 1969

    Default Fabulous. Thanks Steve.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts