Tuesday 15 January 2013

php - mysql find record between dates -



php - mysql find record between dates -

select amount, rh.honoraria_key, rh.honoraria_name xref_speaker_honoraria sh inner bring together xref_contract_speaker xcs on ( sh.contract_id = xcs.contract_id) inner bring together xref_contract_bureau xcb on ( xcs.contract_id = xcb.contract_id) inner bring together ref_contract c on ( xcs.contract_id = c.contract_id ) inner bring together ref_honoraria rh on ( sh.honoraria_id = rh.honoraria_id , rh.display_ext>0) sh.speaker_id = 888 , xcb.brand_id = 27 , cast( c.`start` date ) < '2014-13-02' , cast( c.`end` date ) > '2014-13-02' grouping rh.honoraria_key order rh.display_ext

i have above mentioned query, it's not returning result because of date issue. if remove and cast( c.endas date ) > '2014-13-02' works, want result between 2 dates. info type of c.start , c.end datetype.

any hint prepare ?

i'm not sure why casting date type date type, i've removed here. can utilize between operator check date supplied between start , end

where sh.speaker_id = 888 , xcb.brand_id = 27 '2014-13-02' between `c`.`start` , `c`.`end`

php mysql

No comments:

Post a Comment