i need to know if, given a birth date, a person has more than x years. Thats mean, the client must entry a date in a textbox and i need to know if the persona has more than 18 years.
Thx in advance
View Complete Post
I need a function written in vb to find the exact month difference between two dates.
Start Date : 01/01/2010
End Date : 15/02/2010
then the difference value should be like this 1.5 i.e i need the difference in decimal value.
I am using following code for Robert's Posted Code (Url:http://forums.asp.net/t/1142378.aspx) But this is for only calculate weekends saturday and sunday can any one tell me how I get Number of days between given two dates Monday to Friday.
private const int MONDAY = 1;
private const int TUESDAY = 2;
private const int WEDNESDAY = 3;
private const int THURSDAY = 4;
private const int FRIDAY = 5;
private const int SATURDAY = 6;
private const int SUNDAY = 7;
/// Observe that the method calculates by including the start day, but excludes the end day
/// <param name="startDate"></param>
/// <param name="endDate"></param>
private void GetWeekendDaysBetween(DateTime startDate, DateTime endDate,out int saturdays,out int sundays)
saturdays = -1;
sundays = -1;
if (endDate < startDate)
TimeSpan timeBetween = endDate.Subtract(startDate);
int weekendsBetween = timeBetween.Days / 7;
I am using the below query to get difference beiween two dates in hours and minutes.Minutes part look ok but the hours is incorrect.
select datediff(minute,LastDate,getdate()) as "Minutes", datediff(hour,LastDate,getdate()) as "Hours"from emp.
Note: Using SQL Server 2005
Working days - Mon-Fri and Working hours - 9 Am to 5 Pm
Thur, 14-Oct-10 11.30 Am Thur, 14-Oct-10 5.00 Am 5.30
Fri, 15-Oct-10 11.30 Am Mon, 18-Oct-10 5.00 Am 13.30
Mon, 18-Oct-10 11.30 Am Mon, 18-Oct-10 6.00 Am 5.30
I have 2 datetime columns:
Date1 = 10/1/2010 11:00:00 PM
Date2 = 10/2/2010 1:00:00 AM
I want to subtract Date 2 from Date1 and return the number of minutes difference. Something like:
Date1 - Date2 = 120
How can I do this?
I have one query.
User will input two dates and I want to
print months between those two dates.
Suppose user enters From Date :
1-Apr-2010 and To Date : 15-Oct-2010
So my out put should be like
Please reply me sql query for that one
as it is needed on urgent bases.
I have a calculated column in a list called Days Open. This column contains the number of days between today (Sysdate) and another column called the Effective Date. Therefore, if Sysdate is 11/16/2010 and the Effective Date is 10/14/2010,
how do I calculate the number of days between the two dates?
I tried using this formula: =TEXT(Sysdate-[Effective Date],"h")
and then I tried =INT(Sysdate-Effective Date) & TEXT(Sysdate-Effective Date, ":hh:mm")
Neither formula worked. I hope it is something real simple that I am missing here. Any help you can provide will be highly appreciated!