Summary: | Date interval search returns nothing if you specify the same date as interval | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Marco Menardi <mmenaz> |
Component: | Searches-Advanced | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, marcel.wiesweg |
Priority: | NOR | ||
Version: | 1.0.0 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 1.0.0 | |
Sentry Crash Report: |
Description
Marco Menardi
2009-10-17 00:17:59 UTC
True in current SVN If I search for select * from imageinformation where creationdate >= '2005-10-02T00:00:00' and creationdate <= '2005-10-02T00:00:00'; I get no result, but select * from imageinformation where creationdate >= '2005-10-02T00:00:00' and creationdate <= '2005-10-03T00:00:00'; will give me images. The question is how to treat this now? If I really want images from one day, the querybuilder should detect that the dates in the range are the same and set the end date one step higher. Any other suggestions? Marcel? Andi There is code in the query builder to handle the "Equal" case. The search field should write only one date with the relation "Equal". SVN commit 1036520 by mwiesweg: For the case of same date for begin and end of the interval, do not store an interval but only a single date with the relation "Equal". Note: For any stored search, you must open the advanced search window and click OK once to store the search XML the correct way. BUG: 210845 M +2 -1 NEWS M +37 -12 utilities/searchwindow/searchfields.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1036520 In any case, if I want the pictures of 01/01/09 AND 02/01/09, equal will not be used and I will have just the pics of 01/01/09. The problem is that we want to search for DATE, but a TIMESTAMP (date + time) is stored and managed by database (I suspect, I'm not a digiKam developer). I don't know what database digiKam uses, and if it supports only DATE type field. If not, and to solve a generic case, we have to set to 00.00 the starting date time part, and to 23.59 (or 11.59pm) the end date interval. This is also true if we thing that the Time value could be important to us. Currently we have: select * from imageinformation where creationdate >= '2005-10-02T00:00:00' and creationdate <= '2005-10-02T00:00:00'; that could find only pictures created exactly ad time 00.00.00 of 2005-10-02, that are very unlikely to exist :) With my suggestion we will have: select * from imageinformation where creationdate >= '2005-10-02T00:00:00' and creationdate <= '2005-10-02T23:59:59'; that will sure find the pics created that day. This solution work also in the interval: select * from imageinformation where creationdate >= '2005-10-02T00:00:00' and creationdate <= '2005-10-05T23:59:59'; finding the pictures created 02, 03, 04 and 05 October 2005 I suggest then to reopen the bug and fix this way. |