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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:53:33+00:00 2026-06-09T08:53:33+00:00

I am working with SQLite SQL statement or Query. So far, I was able

  • 0

I am working with SQLite SQL statement or Query.

So far, I was able to figure out some of things by asking stackoverflow question that can cause problem when executing such SQL Statement.

However, I still am not able to get any result?

Here is my SQL Query:

SELECT * 
FROM Alarms 
WHERE ALARMSTATE IN (0,1,2) 
  AND ALARMPRIORITY IN (0,1,2,3,4) 
  AND ALARMGROUP IN (0,1,2,3,4,5,6,7) 
  AND DateTime(ALARMTIME) BETWEEN datetime("2012-08-02 00:00:00") 
                    AND datetime("2012-08-03 00:00:00") 
ORDER BY ALARMTIME DESC

Here is my table as viewed within datagridView control:
As you can see, I have records from yesterdays and the day before in the table.

enter image description here

I corrected all the columns in question of their format such as my ALARMTIME, which is TEXT in data type. Still not getting any result, I decided to run the SQL statement right from within SQLite Administrator application as below. Surprisingly, I got the same result which is nothing or nill or null for dataset. However, SQLite Administrator showed me that DateTime accepts only TIMESTAMP as a parameter not TEXT. If so, my above SQL Statement won’t work even if I have everything else correct. Am I correct in saying that?

enter image description here

  • 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-09T08:53:34+00:00Added an answer on June 9, 2026 at 8:53 am

    Here is my answer. From what I understand, DATETIME supposed to take string or timestamp as a parameter, but in my case it doesn’t work for me.

    Since my column ALARMTIME is TEXT, I am able to query my table with the following SQL statement and retrieve dataset I am looking for.

    SELECT *
    FROM Alarms
    WHERE ALARMSTATE IN (0,1,2)
      AND ALARMPRIORITY IN (0,1,2,3,4)
      AND ALARMGROUP IN (0,1,2,3,4,5,6,7)
      AND ALARMTIME LIKE "2012/08/01%"
      ORDER BY ALARMTIME DESC
    

    I simply can’t convert my ALARMTIME text into datetime type.

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

Sidebar

Related Questions

I'm working some code that inserts csv rows into an SQLite database using Python.
I am struggling to find a working query in SQLite, that will return my
I'm having some trouble working with dates on my Android application that uses SQLite.
I am working on rails 3 and sqlite db. Using a IN query. Currently
I am working on an iOS application that uses a SQLite database. In the
I'm messing around with SQLite for the first time by working through some of
I've been going through some tutorials on working with sqlite databases and they all
I have the following SQL query that I am trying to run inside Microsoft
I'm working on a program using a SQL database (I use SQLite). What my
I'm working on sqlite database on ios 5. What my application does is that

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.