sql语句中时间的比较问题(紧急呼救)
joy19 2004-02-26 01:30:39 各位大侠好!兄弟现在遇到了一些问题,希望大家能帮助我!
我现在要查询数据库,上一个页面的信息是一个日期dateDay1和时间strLate,其中时间的格式是“10时00分00秒”,数据库中的EnterTime是一个String形,现在要在查询语句条件中加上日期等于数据库中的
EnterDate、时间要在strLate之后、10时00分00秒之前。我想问一下应该怎么写?我写的具体语句:String sql6 = " select Branch, Name, EnterTime, EnterDate from 2004-2 where EnterDate = '"+dateDay1+"' and EnterTime >= '"+strLate+"' and EnterTime <= '"+Time+"'";(其中Time我给它赋值为Time="10时00分00秒";)