mysql - Following cfquery result is driving me crazy -
i'm running following query many hours, made sorts of changes wondering why detail query not returning results. have similar queries me other connections well( firstconn, secondconn, fourthconn) running absolutely fine , displaying desired range of dates in output. figure out reason?
<cfquery datasource = "xx.xx.x.xx" name="master"> select str_to_date(date_format(timedetail,'%m-%d-%y'),'%m-%d-%y') thirdconn,count(timedetail) thirdoccurances ,events mydatabase events = "third" group thirdconn; </cfquery> dump third master <cfdump var = "#master#"> <cfquery dbtype="query" name="detail"> select * master thirdconn >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_date"> , thirdconn < <cfqueryparam value="#form.enddate#" cfsqltype="cf_sql_date">; </cfquery> dump third detail <cfdump var = "#detail#">
p.s. test, ran "select * master" in detail query , got identical output master , detail queries expected when mention dates parameters in detail query, stops displaying output.however, not case other connection queries (firstconn, secondconn, fourthconn etc)
is there other way can run query or mistake have done?
dump third master
thirdconn thirdoccurances events 1 {ts '2013-06-06 00:00:00'} 10810 third 2 {ts '2013-06-07 00:00:00'} 8076 third 3 {ts '2013-06-10 00:00:00'} 25043 third 4 {ts '2013-06-11 00:00:00'} 24754 third 5 {ts '2013-06-12 00:00:00'} 14587 third 6 {ts '2013-06-13 00:00:00'} 24828 third 7 {ts '2013-06-14 00:00:00'} 23987 third 8 {ts '2013-06-15 00:00:00'} 28027 third 9 {ts '2013-06-16 00:00:00'} 25190 third 10 {ts '2013-06-17 00:00:00'} 27255 third 11 {ts '2013-06-18 00:00:00'} 22227 third 12 {ts '2013-06-19 00:00:00'} 15951 third 13 {ts '2013-06-20 00:00:00'} 21120 third 14 {ts '2013-06-21 00:00:00'} 24214 third 15 {ts '2013-06-22 00:00:00'} 22466 third 16 {ts '2013-06-23 00:00:00'} 19881 third 17 {ts '2013-06-24 00:00:00'} 23479 third 18 {ts '2013-06-25 00:00:00'} 7879 third
dump third detail
thirdconn thirdoccurances events
sounds have null
value in database throwing off query. try running query this
where isnull(thirdconn,getdate()) >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_date"> , isnull(thirdconn,getdate())< <cfqueryparam value="#form.enddate#" cfsqltype="cf_sql_date">;
where can use date value in place of getdate()
if have null
values confirm issue.
Comments
Post a Comment