Click here to Skip to main content
14,691,238 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friends
i have to text box fist is birth date and second is join date and my problem is how to validate difference between 20 year birth date and join date pls help me

and it is possible to validate to validation control
Posted
Comments
Prasad Khandekar 21-May-13 3:11am
   
Please see this link (http://stackoverflow.com/questions/939802/date-validation-with-asp-net-validator)
Maciej Los 21-May-13 16:19pm
   
What have you done till now?
Where are you stuck?

1 solution

You need to define stored procedure[^] on server side and its content should looks like:
CREATE PROCEDURE GetUserAge
    @birthdate DATETIME,
    @joindate DATETIME 
AS
BEGIN

--SET @birthdate = '1977-07-07'
--SET @joindate =GETDATE()  --today ;)

SELECT DATEDIFF(yy, @birthdate, @joindate) AS Age
END


More:
DATEDIFF (T-SQL)[^]
HOW TO: Call SQL Server Stored Procedures in ASP.NET by Using Visual C# .NET[^]
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900