Dates on SQLite
Hello
I'm trying to create a simple customer report with a search datetime field between parameter, however I don't want reportbuilder ask for time, just to dates: "from" and "to".
How can I achieve this? I am using SQLite as database
It seems the only way is to create the next sentence: SELECT * FROM mytalbe WHERE DATE_FORMAT(date,'%Y-%m-%d') BETWEEN '2014-10-09' AND '2014-10-10'
I want to solve this on design time, I don't want to create any report using runtime events.... is it possible?
Thanks
I'm trying to create a simple customer report with a search datetime field between parameter, however I don't want reportbuilder ask for time, just to dates: "from" and "to".
How can I achieve this? I am using SQLite as database
It seems the only way is to create the next sentence: SELECT * FROM mytalbe WHERE DATE_FORMAT(date,'%Y-%m-%d') BETWEEN '2014-10-09' AND '2014-10-10'
I want to solve this on design time, I don't want to create any report using runtime events.... is it possible?
Thanks
Comments
SELECT *
FROM mytable
WHERE DATE_FORMAT(date,'%Y-%m-%d')
BETWEEN '2014-10-09' AND '2014-10-10' <-- how reportbuilder convert the selected user dates from
calendar control to string values in such formatted string
'BETWEEN 2014-10-09 00:00:000 AND 2014-10-10 00:00:000'
ie - you'll miss any data on the last day with any time after midnight.
I generally deal with this in report builder by using an tdaSQLBuilder object in Report.BeforeOpenDataPipelines where I can adjust the second parameter to '2014-10-10 23:59:59' (although I think it's easier to read with >= AND <=). It's a pain to have to remember but works seamlessly.