Solved

date comparison not working in sqlite query

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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…

717 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