SQl查询 [英] SQl Queries

查看:96
本文介绍了SQl查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的查询

this is my query

SqlDataAdapter da = new SqlDataAdapter("select LD_LDate as Date, LD_Lno as Particular,LD_DCharge as Credit,LD_Amt as Debit from Loandetails where Loandetails.LD_LDate='" + TB_Datetxt.Text + "' union select Dep_Date as Date, Dep_id as Particular,Dep_Amt as Credit,Dep_Mnly_int as Debit from Depositor", con_str);



我的输出应该像这样

日期详细信息贷方借记
1/12/2010支付给Lno1的利息应为500
1/12/2010从Dno1 1000存入的金额应该为空


如何在特殊列"和贷方列"的Datagrid中显示此文本应该为空..在这里,我使用了并集从两个表中进行提取..



MY Output should be like this

Date Particulars Credit Debit
1/12/2010 Interest Paid to Lno1 should be empty 500
1/12/2010 Amount Deposited from Dno1 1000 should be empty


How to display this text in Datagrid of Paricular Column and Credit Column should be empty.. Here I''ve used union for fetching from two table..

推荐答案

Hi ,

您可以在此处使用当情况下使用".

http://blog.sqlauthority.com/2007/04 /14/sql-server-case-statementexpression-examples-and-explanation/
Hi,

You can use "case when then" here.

http://blog.sqlauthority.com/2007/04/14/sql-server-case-statementexpression-examples-and-explanation/


这篇关于SQl查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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