2017-05-08 16:55 | 题主 | ||||||||
|
date型项目作为条件查找的正确使用方法 我在做一个简单的查询画面换面上可以入日期条件,然后数据库是mysql的把比这个日期大的都抽出来: select * from holiday where ({?start_ymd?} is not null and date_format(start_day,'%Y-%m-%d %T') > {?searchParameter1?}) or ({?start_ymd?} is null ) 画面上日期入力项目叫start_ymd,关联的参数叫searchParameter1 可是我怎么弄数据都没有办法抽出,如果不入力那么所有数据可以检索出来的 请问是为什么啊 chrome跟踪的request如下 |
2017-05-08 20:11 | #1 | ||||||||
|
你绕了一个大弯,只要这样就行: where ...{?timestamp.start_ymd?} > start_day... [timestamp.]转换为日期时间类型 |
2017-05-09 17:08 | #2 | ||||||||
|
谢谢回答 我自己又实践过了实际上更加简单 只要viewport里面定义的是date控件 直接写 select * from holiday where (({?start_ymd?} is not null and {?start_ymd?} <= start_day) or ({?start_ymd?} is null )) 就可以了 |
2017-05-11 14:23 | #3 | ||||||||
|
不用{?timestamp.param?}转换吗? |