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.
Author |
Topic |
kixazz2529
Starting Member
1 Post |
Posted - 2007-02-20 : 16:48:22
|
Hey,I am trying to do teh following:Move all records with invalid date of births or date of births under the age of 18 to a table i have created.I have been trying to use the datediff( ) function in an if statement to grab the people who are under the age of 18 but i have had no luck.....if someone could please shed some lightthe following is hwta i have tried but did not work:INSERT INTO tblMemberDataScrubs ( EID, LastName, FirstName, Phone, Gender, DateOfBirth, S_Reason )SELECT tblMemberData.EID, tblMemberData.LastName, tblMemberData.FirstName, tblMemberData.Phone, tblMemberData.Gender, tblMemberData.DateOfBirth, 'Invalid Date' AS S_ReasonFROM tblMemberDataWHERE (DATEDIFF("yyyy", DateOfBirth, GetDate( ))) <=18;and also if you could shed some light on to how to move invalid dates as i am unsure of thisif you could please help me out....i need this ASAPthank ytou very much in advance-justin |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|