如何在sql中的下面代码中编写select查询。 [英] how to write select query in the below code in sql.

查看:87
本文介绍了如何在sql中的下面代码中编写select查询。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sqlstr = "select sum(sal_bonus) as bonusamt from salary_master where sal_deleted = 0 "+
         " and year(sal_bonusdate) = " + lngPreviousYear + " and comp_id = " + strCompanyid +
        " and emp_code = '" + Txt_Employee.Text+ "'" ;
       if (vpcn.gbHalfSalary == true)
       {
           Sqlstr += " and sal_type = '" + vpcn.cSalary_2Half + "' ";
       }
       strBonus = cfs.get_data(Sqlstr);

推荐答案

此查询仅正确



this query is correct only

Sqlstr = "select sum(sal_bonus) as bonusamt from salary_master where sal_deleted = 0 "+
         " and year(sal_bonusdate) = " + lngPreviousYear + " and comp_id = " + strCompanyid +
        " and emp_code = '" + Txt_Employee.Text+ "'" ;
       if (vpcn.gbHalfSalary == true)
       {
           Sqlstr += " and sal_type = '" + vpcn.cSalary_2Half + "' ";
       }
       strBonus = cfs.get_data(Sqlstr);





为什么要重新提交你的问题

你想在这里告诉我们什么



why r u reposting your question
what do you want here tell us clearly


这篇关于如何在sql中的下面代码中编写select查询。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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