Solved

date comparison not working in sqlite query

Posted on 2014-09-21
1
459 Views
Last Modified: 2014-09-21
Database: SQLITE
Table name : TEST_SET_LOG
Column name : DATE_TIME_STAMP datetime

Query1: select DATE_TIME_STAMP from TEST_SET_LOG
Result1: 2014-09-22 02:38:45

Query2: select DATE_TIME_STAMP from TEST_SET_LOG where DATE_TIME_STAMP >= datetime('%s','2014-09-22 00:00:00') and DATE_TIME_STAMP <= datetime('%s','2014-09-22 23:59:00')
Result2: NONE

Query3: select DATE_TIME_STAMP from TEST_SET_LOG where DATE_TIME_STAMP >= strftime('%s','2014-09-22 00:00:00') and DATE_TIME_STAMP <= strftime('%s','2014-09-22 23:59:00')
Result3: NONE

Why am I not getting any result for Query2 and Query3?
0
Comment
Question by:Ravi Kalla
1 Comment
 
LVL 6

Accepted Solution

by:
Ravi Kalla earned 0 total points
ID: 40335011
I got solution. below query is working.
select DATE_TIME_STAMP from TEST_SET_LOG where DATE_TIME_STAMP >= datetime('2014-09-22 00:00:00') and DATE_TIME_STAMP <= datetime('2014-09-22 23:59:00')

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question