If we are having a table named 'MEMBERS' with below details,
then how to fetch the data from the table with the age 18 or more?
S.no Name DOB City
1 sam 19890203 USA
2 andrew 20020304 UK
3 karun 20050827 sydney
4 virat 19870202 India
5 mrunal 19920802 India
Could anyone please help me on this?
Best Answer
Simple logic is based on comparing DOB with the date 18 years before today.
If the datatype of DOB is DATE:
If it's an INT:
If you want to show the age
or for INT
+/- 19000000 is based on the internal format of a Teradata date: