Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Date of Birth

Author  Topic 

micky--4444
Starting Member

19 Posts

Posted - 2010-05-12 : 16:14:44
I need to find all the users whose ideal partner is between two values

First of all in my code I'll get the age of a new registrant. Using the dataReader in ASP.NET

dob = DataReader("DateOfBirth")

After I retrieve the registrants detail and dob I need to find all the ideal partner ages of the users. The format for ideal partners will be a returned string such as 18-30.

I need to check all the users and see if the dob of the new registrant falls between the ideal partner age of say 18-30 and if so select the user(s).

thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-13 : 10:15:56
just pass range through two variables @Low and @High, then use logic like BETWEEN @Low and @High

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -