获取Asp .net当前的财政年度 [英] Get Current financial year in Asp .net

查看:86
本文介绍了获取Asp .net当前的财政年度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从下面的存储过程中获取相应的Asp.net代码(函数)。

可以帮助我。

i want to get it''s corresponding Asp.net code(function) from the belowed Stored procedure.
Can help me.

ALTER PROCEDURE [dbo].[usp_Payroll_CurrentFinancialYear_Select] 
	(@Date DATETIME=NULL)
 AS
BEGIN
		DECLARE @Year INT =0
		DECLARE @Month INT=0
		DECLARE @FinYearID INT=0
		DECLARE @CheckYear VARCHAR(10)=NULL
		SET @Date=ISNULL(@Date,GETDATE())

		SELECT  @Year=YEAR(@Date)
		SELECT  @Month=MONTH(@Date)
 	
		IF(@Month>3)
				BEGIN
					SET @CheckYear=@Year
				END
		ELSE
				BEGIN
					SET @CheckYear=@Year-1
				END
		SELECT @FinYearID=FinYearID
		FROM Common_FinancialYearMaster
		WHERE FinYear LIKE @CheckYear + '%' 
		
		RETURN @FinYearID 
		
END

推荐答案

查看以下链接,它获取当前财政年度。您可以根据您的要求进行调整:

http://www.dotnetpools.com / Article / ArticleDetiail /?articleId = 63 [ ^ ]



也在链接下方,看看它对你有帮助。

sql-server-how-to-dynamically-determine-financial-year [ ^ ]
Take a look at following link, it gets the current financial year. You can tweak based on your requirement:
http://www.dotnetpools.com/Article/ArticleDetiail/?articleId=63[^]

Also below link, see if its helpful to you.
sql-server-how-to-dynamically-determine-financial-year[^]


这篇关于获取Asp .net当前的财政年度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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