i have to date say in MM/DD/YYYY format "1/1/2010" and 1/30/2010". now i want to find dates which comes on monday. so out out will be 01/04/2010, 1/11/2010, 01/18/2010, 01/25/2010
i have a text box named txts_date where the date format is dd/mm/yyyy....and i have a label name lblduration...now my need is i have another text box named lble_date...i want to add the value of duration ie lblduration to txts_date and display it into txte_date...
for example...
txts_date has date 22/11/2010 and lblduration has text as 10 so i want to add both the values so the result would be 02/12//2010..
This may not be correct place to rise this question. Even i'm making here..
My requirement is to get the number of days from from date to end date (for Eg. I have to text boxes from date and to date i will send datetime value to my Stored porcedure i need to calculate no of days between these dates (i.e. no of wroking days) Is there any function to achieve this in SQL SERVER 2005)
I want to calculate the number of days an employee has taken leave in the month of january.For that I have two date fields Leave_Start_Date and Leave_End_Date in the database as follows:
I have a page like this In my SQL, I want calculate some value between these days And this is my code;
strQuery = @"SELECT B.HESAP_NO, A.TEKLIF_NO1 + '/' + A.TEKLIF_NO2 AS 'TEKLIF', B.MUS_K_ISIM, CONVERT(VARCHAR(10),A.ISL_TAR,103) AS 'TARIH', SUM(ISNULL(CAST(A.ODENEN_ANAPARA AS FLOAT),0)+ISNULL(CAST(A.FAIZ AS FLOAT),0)+ ISNULL(CAST(A.BSMV AS FLOAT),0)+ISNULL(CAST(A.GECIKME_FAIZ AS FLOAT),0)+ ISNULL(CAST(A.GECIKME_BSMV AS FLOAT),0)) AS 'YATAN', (CASE WHEN B.DOVIZ_KOD = 21 THEN 'EUR' WHEN B.DOVIZ_KOD = 2 THEN 'USD' WHEN B.DOVIZ_KOD = 1 THEN 'TL' END) AS 'KUR', D.AVUKAT, (CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN (SELECT ICRA_TAR FROM TAKIP WHERE T_HESAP_NO = D.HESAP) ELSE ' ' END) AS 'ICRA TARİHİ', (CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN (SELECT HACIZ_TAR FROM TAKIP WHERE T_HESAP_NO = D.HESAP) ELSE '' END) AS 'HACİZ TARİHİ' FROM YAZ..MARDATA.BIR_TAHSIL A, YAZ..MARDATA.S_TEKLIF B, AVUKAT D WHERE A.TEKLIF_NO1 = B.TEKLIF_NO1 AND A.TEKLIF_NO2 = B.TEKLIF_NO2 AND B.HESAP_NO = D.HESAP AND A.HESAP_NO = D.HESAP "; if (txtBoxText1 != "") { strQuery = strQuery + " AND A.ISL_TAR >= @S_TARIH_B"; dt_stb = DateTime.Parse(txtBoxText1); myCommand.Parameters.AddWithValue("@S_TARIH_B", dt_stb); } if (txtBoxText2 != "") { strQuery = strQuery + " AND A.ISL_TAR <= @S_TARIH_S"; dt_sts = DateTime.Parse(txtBoxText2); myCommand.Parameters.AddWithValue("@S_TARIH_S", dt_sts); } strQuery = strQuery + " GROUP BY B.HESAP_NO, A.TEKLIF_NO1 + '/' + A.TEKLIF_NO2,A.ISL_TAR,B.DOVIZ_KOD ,B.MUS_K_ISIM, D.AVUKAT, D.HESAP"; And this is my Function; ALTER FUNCTION [dbo].[fngcodeme] ( @HESAP INT,@BAS DATE, @BIT DATE,@DOV INT ) RETURNS FLOAT AS BEGIN RETURN( SELECT SUM(TUTAR) FROM 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 ISL_TAR >= @BAS AND ISL_TAR <= @BIT ) END
What I want getting a value in this code with this function. @BAS is Start Date, @BIT is End Date How can I associate @BAS with Textbox1 and @BIT with Textbox2 ?
i'm making an holiday calendar where i need to find all sunday dates in a given year and insert into particualr table.. i have done wit half f my query just half is remaining.
I've a Dictionary object created in which i keep adding a key value pair.The key value pair is of type "object"The value part contains date in this format "2010-11-17T08:51:51-05:00". This dictionary object has an array of date stored in this format.Can someone out in converting this to a right date format and then find the latest date of the entire lot.
I have two textbox as naming : txtInitiateDt and txtDisposalDt.
When user give 2nd textbox value from datepicker it should chk whether the given value shouldn't more than to date and also less that 1st textbox value.
I did it & also works good...bt there's an error arise when i host the site on client machine where only framework and database is present.
And the error is "String Value is not in correct dateformat" and fr this exception other events are blocked.
I've read the MSDN page describing the Localize control and read about the difference between designers in the following link:http://my.safaribooksonline.com/0321341384/app01lev2sec53 Still, I can't find any visual difference between the Localize and Literal control in the designer view of VS 2010.I've tried using explicit and implicit expressions in an aspx and the designer looks the same for both controls - shows the neutral culture resource.I've looked at the LocalizeDesigner code in reflector and the only thing the designer seems to localize is the HTML format of the outputed span control, and that seems irellevant to the designer.Can anyone attach a short example that demonstrate when the two controls behave differently?
I need some pointers to start on this.We are building a time off application where three instances of a calendar control will be displayed ( prev - current and next month) now users can click on various dates accross all three instances and then a count of number of days should be diaplyed in the parent textbox.
To begin with this, i started with adding the dates clicked by the user in Calendar2_SelectionChanged method into a list<> so that i can get the all dates user clicked and then add it to calander's selected dates collection. But this throws an e" object reference not set" error.
Is there anyother way to get all the dates that user click onthe calendar( note the dates doesn't get highlighed so seleteddates doesnt work)does anyone has a good example for this.