asp.net - Using Date.Now in SQL Function -


I have the function ;

  Optional function [dbo]. [Fngcodeme] as stated initially Boat @Result (@HESAP in INT, @DOV INT, @TEKLIF VARCHAR (10), dates, @BIT datetime @BAS) If the CONVERT (DATETIME, @ BIT, 103) & lt; = '20110228' set @Result = (sum (TUTAR) YAZ..MARDATA.M_HAREKET where TEMEL_HESAP = @HESAP and DOVIZ_KOD = @DOV and REF_KOD = 'GC' and BACAK_GRUP = 'PERT' and ISL_KOD = 1 and selected ACIKLAMA like '%' + @TEKLIF + '%' and ISL_TAR & gt; = CONVERT (DATETIME, @ bass, 103) and ISL_TAR & lt; = CONVERT (DATETIME, @ BIT, 103)) and set @Result = (sum select (TUTAR) YAZ..MARDATA.M_GHAREKET where TEMEL_HESAP = @HESAP and DOVIZ_KOD = @DOV and REF_KOD = 'GC' and BACAK_GRUP = 'PERT' and ISL_KOD = 1 and the ACIKLAMA '%' + @TEKLIF + '% and ISL_TAR & gt; = CONVERT (DATETIME, @ bass, 103) and ISL_TAR & lt; = CONVERT (DATETIME, @ BIT, 103)) returns @Result end   

M_GHAREKET table my mother Seek Data Is The Table Month of loading table at the end M_HAREKET (and All data M_GHAREKET are deleted)

M_HAREKET a The big bucket is M_GHAREKET is small (I mean M_HAREKET now exceeds 500,000 data, M_GHAREKET more than 4.000)

What do I want for function , if @BAS is equal to the value of the month of the date DateTime.Now.Month the value I want to use M_GHAREKET < / Code> table, and use the M_HAREKET table.

How should I change this function like this?

Is it possible if is in DateTime.Now.Month with the function ?

Or should I use it in my ASP.NET page? How can I do this?

You can use and.

  (BAS) and year (sociable ()) = year (@bas)    

Comments