Hi All,
I'm running Crystal 8.5 with a SQL 7 database. This is a report that is grouped by location and then department. What I'm trying to find is the number of active people. I have a formula that looks similiar to this one that I'm running in the GroupFooter2 section:
=====================================================
Local StringVar Termdate := Left({cccusers.term_date}, 10);
//Local StringVar Hiredate := Left({cccusers.hire_date}, 10);
if NOT isNull({cccusers.term_date}) then
//isDate(Termdate)
CDateTime(Left({cccusers.term_date}, 10));
==========================================
Term_date is the date a person was terminated and hire_date is self-explanatory. When using hire_date (both are string fields in SQL) in the above formula I have no problems (but every person has a hiredate). When I substitute hire_date with term_date I get a Bad Date-Time format string error even though the formats of these two fields are identical.
When I use the isDate function to test with I recieve no errors. I thought the error was due to the fact that not all records have a term_date which is why I have the "NOT isNull". I still kinda think that's the problem though.
Any suggestions would be appreciated,
NGonz
I'm running Crystal 8.5 with a SQL 7 database. This is a report that is grouped by location and then department. What I'm trying to find is the number of active people. I have a formula that looks similiar to this one that I'm running in the GroupFooter2 section:
=====================================================
Local StringVar Termdate := Left({cccusers.term_date}, 10);
//Local StringVar Hiredate := Left({cccusers.hire_date}, 10);
if NOT isNull({cccusers.term_date}) then
//isDate(Termdate)
CDateTime(Left({cccusers.term_date}, 10));
==========================================
Term_date is the date a person was terminated and hire_date is self-explanatory. When using hire_date (both are string fields in SQL) in the above formula I have no problems (but every person has a hiredate). When I substitute hire_date with term_date I get a Bad Date-Time format string error even though the formats of these two fields are identical.
When I use the isDate function to test with I recieve no errors. I thought the error was due to the fact that not all records have a term_date which is why I have the "NOT isNull". I still kinda think that's the problem though.
Any suggestions would be appreciated,
NGonz