?
Solved

date comparison not working in sqlite query

Posted on 2014-09-21
1
Medium Priority
?
506 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

770 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