I have three date fields that I am trying to subtract and get a number of years. Two of the are dob and one is just date entered, I only need to use one of the dob fields, but I cannot get the subtract to work on any of them
1st date is - dob (varchar(15), null)
2nd date is - date (datetime, null)
3rd date is tdob is - (datetime, notnull)
my issue is when I try to subtract the two dates I get this error.
Arithmetic overflow error converting expression to data type datetime.
If I convert the two dates to varchar(10),101 format and try to subtract I get this error.
The data types varchar and varchar are incompatible in the subtract operator.
If I use the tdob field I get
Arithmetic overflow error converting expression to data type datetime.
If I convert only the tdob to Varchar(10) and not the date field,
Arithmetic overflow error converting expression to data type datetime.
If I convert both to Varchar(10) I get this error
The data types varchar and varchar are incompatible in the subtract operator
And last if I only conver the date field and not the tdob field
Arithmetic overflow error converting expression to data type datetime.
I know this is confusing, but I really need to get the age of the person between these two dates.