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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid use of null?

Status
Not open for further replies.

dm1

IS-IT--Management
May 6, 2000
22
US
Hi folks, I'm getting an inavalid use of null error when i run a query of:

SELECT DISTINCTROW Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate, Sum(CLng([Quantity]*[UnitPrice]*(1-[Discount])*100)/100) AS [Total Sales], Sum([Order Details].Quantity) AS [Total Units]
FROM Orders LEFT JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
WHERE (((Orders.OrderType)="1"))
GROUP BY Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate;

Can anyone see where I'm going wrong?

Cheers, Jon. [sig][/sig]
 
You may want to bracket all your fields with iif(isnull(YOUR_VALUE),0,YOUR_VALUE) this will give you the freedom to leave a field null...I would also suggest making the default value of your fields to 0 (zero) and running an update querry.
 
Thanks guys, it was a null field I'd overlooked and have set it as required before form can be closed now.

Cheers, Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top