Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:58:36+00:00 2026-06-06T03:58:36+00:00

I store dates as String in my database, in this format: YYYY-MM-DD HH:MM and

  • 0

I store dates as String in my database, in this format:

YYYY-MM-DD HH:MM

and in my db I have rows (all columns are strings):

       COL1        |     COL2
----------------------------------
'2012-06-21 18:53' |   'item1'
'2012-06-21 18:54' |   'item2'
'2012-06-21 18:55' |   'item3'

Now I want to compare these stored dates (well, strings), and this is very very strange:

this query

select * 
  from MyTable 
  where col1 > Datetime('2012-06-21 18:53') 

returns 2 rows (all except first) – this is correct.

but this query

select * 
      from MyTable 
      where col1 >= Datetime('2012-06-21 18:53')

return also only 2 rows, but it should return all 3 rows, as I used >= instead of >.

What did I wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:58:38+00:00Added an answer on June 6, 2026 at 3:58 am
    sqlite> SELECT datetime('2012-06-21 18:53');
    2012-06-21 18:53:00
    

    datetime() returns a string in a different format than the fields of your database. You can use just the string for WHERE, e.g.

    select * 
          from MyTable 
          where col1 >= '2012-06-21 18:53'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am storing all my dates in UTC format in my database. I ask
in my database , dates are stored in DD-mm-yyyy format , how can i
I have a SQLite database where I store the dates as ticks. I am
I have a String which looks like this NSString *string = @2012-04-30T23:59:00+10:00; Right now,
I have legacy DB that store dates that means no-date as 9999-21-31, The column
I am developing a geneology application, and I have a need to store dates
In my site i have to store two types of delivery dates contract delivery
I have a database that stores dates broken into int's. I.e. Day, Month and
I have an existing database that was setup (for whatever reason??) to store a
I'm trying to store today's date in a sqlite table as a string in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.