在查询分析器里面的代码是:
create procedure proc_customerbuytotal
@datefrom datetime,
@dateto datetime
as
select sales.customercode, customer.customername,customer.company,customer.tel,customer.address,customer.postcode,
sum(salesdetail.saleqty*salesdetail.actprice)'amount'
from sales,salesdetail,customer
where(sales.customercode <>"and sales.customercode is not null)
and customer.customercode=sales.customercode
and sales.billno=salesdetail.billno
and (sales.saledate>= @datefrom and sales.saledate<[email protected])
group by sales.customercode,customer.customername,customer.company,customer.tel,customer.address,customer.postcode
order by sales.customercode
go
------解决方案--------------------
where(sales.customercode <>"and sales.customercode is not null)
---------
你那是个双引号,应该是2个单引号