Sql查询通知使用聚合函数SUM [英] Sql Query Notification With aggregate function SUM

查看:219
本文介绍了Sql查询通知使用聚合函数SUM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,我正在使用SQL中的一个强大功能,即Sql Query Notification。我已经尝试了它并且效果很好但是当我已经使用聚合函数Sum时,我得到错误说INVOKE OR BEGIN在窗口处理已被创建的情况下无法调用控件..我所知道的是错误来自我的查询,它使用聚合函数求和,这就是为什么如何在SQL QUERY NOTIFICATION中使用聚合函数SUM?这是我的查询表格请检查它..我100%确定问题出在我的查询中..请帮助..谢谢:)

Good day, I am using one of the powerful functionality in SQL which is Sql Query Notification.. I'' tried it and it works great but when i already use aggregate function Sum, i got error saying that "INVOKE OR BEGIN CANNOT BE CALLED ON A CONTROL UNTIL THE WINDOW HANDLE HAS BEEN CREATED".. What i know about this is that the error was came from my query which uses Aggregate Function Sum thats why How to use Aggregate function SUM in SQL QUERY NOTIFICATION ? here is my query form kindly check it .. i am 100% sure that the problem is in my query.. please do help.. thank you :)

SELECT
SALES_ORDER.SALES_ORDER_ID AS [SALES ORDER ID],
CUSTOMER.CUSTOMER_NAME AS [CUSTOMER NAME], 
SALES_ORDER.OrderDate, 
SALES_ORDER.ORDERSTATUS AS [STATUS],
SUM(ORDERLINE.AMOUNT) AS [TOTAL AMOUNT]
FROM dbo.SALES_ORDER 
INNER JOIN dbo.CUSTOMER ON dbo.CUSTOMER.CUSTOMER_ID = dbo.SALES_ORDER.CUSTOMER_ID
INNER JOIN dbo.ORDERLINE ON dbo.ORDERLINE.SALES_ORDER_ID = dbo.SALES_ORDER.SALES_ORDER_ID
WHERE dbo.SALES_ORDER.ORDERSTATUS = ''PENDING'' 
OR dbo.SALES_ORDER.ORDERSTATUS = ''COMPLETED'' 
OR dbo.SALES_ORDER.ORDERSTATUS = ''PROVISIONING''
AND 
dbo.ORDERLINE.OrderLineStatus = ''PENDING'' 
OR dbo.ORDERLINE.OrderLineStatus = ''COMPLETED'' 
OR dbo.ORDERLINE.OrderLineStatus = ''PROVISIONING''
GROUP BY dbo.SALES_ORDER.SALES_ORDER_ID, dbo.CUSTOMER.CUSTOMER_NAME, dbo.SALES_ORDER.OrderDate,dbo.SALES_ORDER.ORDERSTATUS
ORDER BY [SALES ORDER ID] DESC

推荐答案





我认为它不是查询问题,前端代码中的问题。

查看以下链接

错误:无法调用Invoke或BeginInvoke一个控件,直到创建窗口句柄 [ ^ ]

调用或者在控件上调用BeginInvoke [ ^ ]

问候,

GVPrabu
Hi,

I think its not Query Proble, Problem in Frontend Code.
Check the following Links
Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created[^]
Invoke or BeginInvoke cannot be called on a control until the window handle has been created[^]
Regards,
GVPrabu


这篇关于Sql查询通知使用聚合函数SUM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆