对接oracle的时间查询
#define DEF_CLOSE_TIME "9:00:00"
AnsiString strSQL = "SELECT date,time,value FROM shane ";
strSQL += "WHERE '";
strSQL += pForm3->DateTimePicker2->Time.TimeString();
strSQL += (String("'<= cdate(time) AND cdate(time) <='") + DEF_CLOSE_TIME + "'");
strSQL += "AND cdate(left(date,4)+'-";
strSQL += "'+mid(date,5,2)+'-";
strSQL += "'+right(date,2))='";
strSQL += pForm3->DateTimePicker1->Date.DateString();
strSQL += "'";
日期、时间都是用字符串形式保存的,而且日期是20101124这种形式。以上sql可以用于access的查询,但是对接oracle,如何改成to_date()呢
[解决办法]
to_date('2010-11-24','YYYY-MM-DD')
[解决办法]
该回复于2010-12-01 16:43:42被版主删除