Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Can anyone sport a syntax error with this sql command - driving me mad:

Code:
SELECT SUM(DUEQTY_11) as issQty FROM ("Order Master" INNER JOIN "Requirement Detail" ON "Order Master".ORDER_10 = "Requirement Detail".ORDER_11) INNER JOIN "Job Progess" ON "Order Master".ORDER_10 = "Job Progress".ORDNUM_14 WHERE "Order Master".TYPE_10 = 'MF' AND "Order Master".STATUS_10 = '3' AND "Requirement Detail".PRTNUM_11 = '18101961' AND "Job Progress".OPRSEQ_14 = '0001' AND "Job Progress".MOVDTE_14 <> NULL

Error message is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Pervasive][ODBC Client Interface][Pervasive][ODBC Engine Interface]Syntax Error: DNUM_14 WHERE "Order Master".TYPE_10 = 'MF' AND "Order Master".STATUS_10 = '3' AND "Requirement Detail".PRTNUM_11 = '18101961' AND "Job Progress".OPRSEQ_14 = '0001' AND "Job Progress".MOVDTE_14 <> NUL<< ???


"Job Progress".MOVDTE_14 is a date field and I want to get all records where there is no date in that field.

Mighty
 
I believe that the correct syntax when dealing with null is "is null" or "is not null" so you're query would be:
Code:
SELECT SUM(DUEQTY_11) as issQty FROM ("Order Master" INNER JOIN "Requirement Detail" ON "Order Master".ORDER_10 = "Requirement Detail".ORDER_11) INNER JOIN "Job Progess" ON "Order Master".ORDER_10 = "Job Progress".ORDNUM_14 WHERE "Order Master".TYPE_10 = 'MF' AND "Order Master".STATUS_10 = '3' AND "Requirement Detail".PRTNUM_11 = '18101961' AND "Job Progress".OPRSEQ_14 = '0001' AND "Job Progress".MOVDTE_14 IS NOT NULL

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top