我正在制作Windows Application
,因为我正在创建用于制作报告的数据集,因为我正在使用一个已经成功运行的查询来显示网格中的数据。但它不适用于数据集。
查询:
select sum (case when Buy_sell=1 then Trade_Qty else 0 end) as BuyQty,
sum (case when Buy_sell=1 then Market_Rate else 0 end) as BuyRate,
sum (case when Buy_sell=1 then Trade_Qty*Market_Rate else 0 end) as BuyAmount,
sum (case when Buy_sell=2 then Trade_Qty else 0 end) as SellQty,
sum (case when Buy_sell=2 then Market_Rate else 0 end) as SellRate,
sum (case when Buy_sell=2 then Trade_Qty*Market_Rate else 0 end) as SellAmount
from tradeFile
where Party_Code=@pcode and Sauda_Date like @saudaDate% and Scrip_Code=@scripCode
它给我在 Sauda_Date 附近的 % 错误,如 @saudaDate%。如果我删除 % 它不会给出错误,但它没有给我预期的结果。
查询文本:
Error in WHERE clause near 'AND'.
Unable to parse query text.
是否有另一种方法可以为数据集编写 like-% 查询?
请帮我。