如何使用财政年度显示报告? [英] How to display reports using financial year?

查看:80
本文介绍了如何使用财政年度显示报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



i我正在使用带有asp.net的C#。

i无法使用颗粒月份从数据库中获取数据。 />
这是当年:

 DateTime sys = System.DateTime.Now; 



 year = sys.Year; 



这是明年:

 DateTime next = sys.AddYears(1); 



 Next = next.Year; 





这是我查询的一部分:

字符串查询=选择DISTINCT(App_Code),App_Name来自Appraisal,其中年份(App_Date)> ='+ year +'和YEAR(App_Date)< ='+ Next +'; 





现在这个查询显示了jan,feb,march月份的数据..我不想显示。

因为这是上一个财政年度。

所以请帮助我。我该怎么办?

解决方案

尝试这个



 string query =从评估中选择DISTINCT(App_Code),App_Name,其中datepart(yy,App_Date)> ='+ year +'和datepart(yy,App_Date)< ='+ Next +'; 


hello,

i am using C# with asp.net.
i am unable to fetch data from database using particulate month.
this is for current year:

DateTime sys = System.DateTime.Now;


year = sys.Year;


this is for next year :

DateTime next =sys.AddYears(1);


Next = next.Year;



this is part of my query:

string query = "select DISTINCT(App_Code),App_Name from Appraisal where year(App_Date)>='" + year + "' and YEAR(App_Date)<='" + Next + "'";



now this query shows the data of month of jan,feb,march.. which i dont want to show.
because this is a last financial year.
So please help me for that. what can i do?

解决方案

TRY THIS

string query = "select DISTINCT(App_Code),App_Name from Appraisal where datepart(yy,App_Date)>='" + year + "' and datepart(yy,App_Date)<='" + Next + "'";


这篇关于如何使用财政年度显示报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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