Solved

date comparison not working in sqlite query

Posted on 2014-09-21
1
470 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

697 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