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 8719019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:41:16+00:00 2026-06-13T06:41:16+00:00

I have to select all rows from database by just passing date. For example

  • 0

I have to select all rows from database by just passing date. For example to get all rows that have date 10/23/2012

In sqlite db I store this in DATE column:

01/01/1900 11:00:00 AM

I have tried to get by using date() but I get nothing for date:

select itemId, date(dateColumn) from items

So all I need is to compare only dates but can’t find how to do this in sqlite.

  • 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-13T06:41:17+00:00Added an answer on June 13, 2026 at 6:41 am

    Firstly, format your dates to the ISO-8601 standard. Wrap it in Date() to ensure it gets processed as a DATE. Finally, construct your range so that it will include everything from 12:00am onwards until just before 12:00am the next day.

    select itemId, dateColumn
    from items
    where dateColumn >= date('2012-10-23')
      AND dateColumn <  date('2012-10-23', '+1 day')
    

    SQLite columns are not typed. However, if you compare the column to a DATE as shown, it is sufficient to coerced the column data into dates (null if not coercible) and the comparison will work properly.

    Example on SQLFiddle:

    create table items (
      itemid, datecolumn);
    insert into items select
      1,'abc' union all select
      2,null union all select
      3,'10/23/2012 12:23' union all select
      4,'10/23/2012' union all select
      5,'2012-10-23 12:23' union all select
      6,'2012-10-23' union all select
      7,'2012-10-24 12:23' union all select
      8,'2012-10-24' union all select
      9,date('2012-10-24 12:23') union all select
      10,date('2012-10-24');
    

    Results:

    itemid  datecolumn
    5       2012-10-23 12:23
    6       2012-10-23
    

    Note that although rows 3 and 4 appear to be dates, they are not, because they do not conform to ISO-8601 formatting which is the only format recognized by SQLite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQLite database with with just over 6,000 rows of addresses in
I need to select all of the rows from the database where there is
Ok, so I have a function that selects certain rows in a sqlite database
I have a select-all jquery script I got from a site (I forgot the
I have jQuery to select all font elements that are children of the element
I want to select all elements that have an accesskey defined on them. I
I am attempting to select all a hrefs that do not have the class
I'm trying to select all dom elements that have id=mydiv but exclude the ones
I would like to select all elements that have certain attribute or don't have
I want to select all categories from a webservice. The webservice does not have

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.