Home > database >  The couple finereport for help
The couple finereport for help

Time:09-16

To ask teachers to brush with data set parameter to select data from a certain time, write SQL is such a select * from cxhnweixin. FPV_FARM_PAY_VOUCHER
Where the status='finish'
${the if (len (starttime)=0, ""," the and finish_time & gt; + starttime='" + "' ")}
${the if (len (endtime)=0, ""," the and finish_time & lt; '" + endtime + "' ")}
But set parameters according to the text and the format string does not match, looked at the data, the inside of the finish_time format is yyyy - MM - dd HH - MM - ss, I guess I didn't set time format, but don't know how to set up again, to consult the teachers (new pure oneself see tutorial, no taught, small white place please forgive me)

CodePudding user response:

Table is inside there are a lot of time data, requirement is two time as parameters, through the control changes the two time to show the data between the two time

CodePudding user response:

Resolved
Select * from cxhnweixin. FPV_FARM_PAY_VOUCHER
Where the status='finish'
And finish_time & gt;=cast (to_date (' ${starttime} ', '- dd yyyy - mm hh24: mi: ss') as timestamp)
And finish_time & lt; Cast (to_date (' ${endtime} ', '- dd yyyy - mm hh24: mi: ss') as timestamp)
The order by finish_time
  • Related