smn
July 21st, 1999, 12:48 AM
I want to use a SQL statement with condition to get records,
the condition is date>DEC. 30,1996. But the database returns
error, either I look on the "date" field as CHAR-typed or
VALUE-typed. In my program, this field named "date" is CTIME-
typed in CRECORDSET,while SQL_C_CHAR-typed in SQLALLOCHANDLE.
Whatever I type like these,they don't work:
sr=SQLExecDirect(stmt,
(SQLCHAR*)"select * from stock where date='19961230'"
,SQL_NTS);
sr=SQLExecDirect(stmt,
(SQLCHAR*)"select * from stock where date>19961230"
,SQL_NTS);
Can anybody help me,please?
the condition is date>DEC. 30,1996. But the database returns
error, either I look on the "date" field as CHAR-typed or
VALUE-typed. In my program, this field named "date" is CTIME-
typed in CRECORDSET,while SQL_C_CHAR-typed in SQLALLOCHANDLE.
Whatever I type like these,they don't work:
sr=SQLExecDirect(stmt,
(SQLCHAR*)"select * from stock where date='19961230'"
,SQL_NTS);
sr=SQLExecDirect(stmt,
(SQLCHAR*)"select * from stock where date>19961230"
,SQL_NTS);
Can anybody help me,please?