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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:10:02+00:00 2026-05-11T06:10:02+00:00

It seems like a dumb question, and yet. It could be my IDE that’s

  • 0

It seems like a dumb question, and yet. It could be my IDE that’s goofing me up. Here’s the code (this is generated from DbLinq):

SELECT  pics$.Caption, pics$.Id, pics$.Path, pics$.Public, pics$.Active, portpics$.PortfolioID FROM main.Pictures pics$ inner join main.PortfolioPictures portpics$    on  pics$.Id = portpics$.PictureId  WHERE   portpics$.PortfolioId = 1 AND pics$.Id > 0 --AND pics$.Active = 1 AND pics$.Public = 1 ORDER BY pics$.Id 

If I run this query I get three rows back, with two boolean fields called Active and Public. Adding in the commented out line returns no rows. Changing the line to any of the following:

pics$.Active = 'TRUE' pics$.Active = 't'  pics$.Active =  boolean(1) 

It doesn’t work. Either errors or no results. I’ve googled for this and found a dearth of actual SQL queries out there. And here we are.

So: how do I use a boolean field in a where clause in SQLite?

IDE is SQLite Administrator.

Update: Well, I found the answer. SQLite Administrator will let you make up your own types apparently; the create SQL that gets generated looks like this:

CREATE TABLE [Pictures] ([Id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL, [Path] VARCHAR(50)  UNIQUE NOT NULL,[Caption] varchAR(50)  NULL, [Public] BOOLEAN DEFAULT '0' NOT NULL,[Active] BOOLEAN DEFAULT '1' NOT NULL) 

The fix for the query is

AND pics$.Active = 'Y' AND pics$.Public = 'Y' 

The real issue here is, as the first answerer pointed out, there is no boolean type in SQLite. Not an issue, but something to be aware of. I’m using DbLinq to generate my data layer; maybe it shouldn’t allow mapping of types that SQLite doesn’t support. Or it should map all types that aren’t native to SQLite to a string type.

  • 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. 2026-05-11T06:10:02+00:00Added an answer on May 11, 2026 at 6:10 am

    SQLite does not have the boolean type: What datatypes does SQLite support?

    The commented-out line as it is should work, just use integer values of 1 and 0 in your data to represent a boolean.

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

Sidebar

Related Questions

This seems like an incredibly dumb question to have to ask, but how do
Sorry if this seems like a dumb question but I am just learning bash
This may be a dumb question but it seems like activateIgnoringOtherApps: may be the
I come from frontend background, so I apologize if this db question seems dumb.
This seems like a dumb question, but I couldn't see any way to do
Seems like this is a dumb question, but I need something... substantial. I have
I know this seems like a dumb question but how do I search a
Ok this seems like a dumb question and probably is but I cannot figure
Yeah, I know this seems like a dumb question, its just a one-off hack
This may seem like a dumb question, but can an app build with c#

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.