计算并在gridview中显示 [英] Calculate and display in gridview

查看:66
本文介绍了计算并在gridview中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的带有accessdatabase的asp.net + vb web中。具有进行计算的查询网页。

In my asp.net+vb web with accessdatabase. Have query web page in which calculation is made.

SELECT AUTH.company
    ,AUTH.Auth
    ,Count(AUTH.company) AS Held
    ,(AUTH.Auth - Count(AUTH.company)) as [Sur/Defi]
FROM pers INNER JOIN AUTH ON pers.company = AUTH.company
GROUP BY AUTH.company,AUTH.Auth





对于指定人员的公司,计算是正确的



但是如果这个人没有被张贴,甚至公司的授权书都在那里,那么这个名字就不会反映在这个网页上。例如:_



The calculation is correct for those company in which persons are appointed

But if the person is not posted and even the company's auth is there then that names are not reflected in this web page. eg:_

Comapany            Auth     

Tata                12



并且没有人在这家公司发布然后这个公司名称没有被反馈



即使有公司名称也应该来没有人张贴在其中


and no one is posted in this company then this company name is not refelected

The company names should come even if there is no one posted in it as

Comapany            Auth         Held               Sur/Defi     

Tata                12             0                     12



我想要再添加一个条款。有一个名为post的表,其中的字段名称是公司(在此表中输入了转移)。



i想要再一次计算以及上面的查询是if transters在邮政表中输入然后他们应该在girdview中反映为OUT。



我的编码在VB中


and i want to add one more clause. There is a table named post and the field name in that is company (in this table transfers are entered).

i want one more calculation alongwith the above query is if transters are entered in post table then they should reflect as OUT in girdview .

My coding is in VB

推荐答案

如果我理解正确的话,你需要做的就是切换你的JOIN:

If I understand you correctly, all you need to do is switch your JOIN:
SELECT AUTH.company
    ,AUTH.Auth
    ,Count(AUTH.company) AS Held
    ,(AUTH.Auth - Count(AUTH.company)) as [Sur/Defi]
FROM AUTH LEFT OUTER JOIN pers ON pers.company = AUTH.company
GROUP BY AUTH.company,AUTH.Auth



我不太了解有关转让的部分,需要更多信息。


I don't quite understand the part about the transfers, need more info.


这篇关于计算并在gridview中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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