V5 SQL question
Posted in 1994
I've got a quick sql question having to do with expression fields. I'm sending a sql statement through ODBC to a sql server. I'm calculating age in yrs from a dob field in a table. In doing this calculation informix figures that the expression can be 30 chars wide and all i need is the last 3 or 4. I need a sql function that will allow me to trim all the leading blanks or a better way to calculate age. I'd rather not parse out what i need from the returning string since it's part of a much larger select statement. Here's what i'm doing... select trunc((today-dob)/365) from some_tab dob is defined as a date field in some_tab. Any and all help much appreciated, Email or responses to the group is fine. If there's interest, i can post a summary. Doug Reed dereed@netcom.com