Say I have a ContactDetails table with the following fields:
ContactID, ContactName, DateOfBirth, SpouseName, SpouseDateOfBir th, ChildName, ChildDateOfBirt h (and some other fields not worth mentioning)
I pass in 2 parameters: eg. fromDate='19001 111' and toDate='2007111 1'
If DateOfBirth is between fromDate and toDate I want to return ContactName and DateOfBirth
AND If SpouseDateOfBir th is between fromDate and toDate I want to return SpouseName and SpouseDateOfBir th
AND If ChildDateOfBirt h is between fromDate and toDate I want to return ChildName and ChildDateOfBirt h
If it is possible, how would a query look which returns these columns?
ContactID, ContactName, DateOfBirth, SpouseName, SpouseDateOfBir th, ChildName, ChildDateOfBirt h (and some other fields not worth mentioning)
I pass in 2 parameters: eg. fromDate='19001 111' and toDate='2007111 1'
If DateOfBirth is between fromDate and toDate I want to return ContactName and DateOfBirth
AND If SpouseDateOfBir th is between fromDate and toDate I want to return SpouseName and SpouseDateOfBir th
AND If ChildDateOfBirt h is between fromDate and toDate I want to return ChildName and ChildDateOfBirt h
If it is possible, how would a query look which returns these columns?
Comment