Solved

date comparison not working in sqlite query

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Read about achieving the basic levels of HRIS security in the workplace.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now