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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:39:06+00:00 2026-06-13T12:39:06+00:00

I have a users hours worked stored in SQLite as HH:MM in my Android

  • 0

I have a users “hours worked” stored in SQLite as HH:MM in my Android application. I do not want to change the way this data is stored, if possible. That would be a nightmare. I want them to be able to search entries in which their time is =,<, or > another timestamp.

For example, using my app they can make a WHERE clause like the following: time(Hours) > time('5:51') where Hours is the column name. However, I can’t seem to get any results, even if I know there’s a matching row.

Am I doing something wrong? I don’t get any exceptions, just no results.

  • 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-13T12:39:06+00:00Added an answer on June 13, 2026 at 12:39 pm

    time will not accept durations unless they are coincidentally also valid times. So even though someone can work 40 hours:

    SELECT (time('40:00') IS NULL);
    

    gives 1 (showing it’s an error).

    SELECT (time('11:00') IS NULL);
    

    is 0. But presumably both need to work.

    Luckily, if you stick to two-digit hours and two-digit minutes, you can compare them as ordinary strings.

    SELECT '84:13' > '29:03';
    1
    
    SELECT '05:12' > '43:58';
    0
    

    EDIT: A better solution might be to simply store the number of minutes as an INTEGER (one of the SQLite base types). Yes, you need to do a one-time upgrade conversion, but I think it’s a better choice.

    You have complete precision, you can easily multiply (e.g. by an hourly rate), and it’s a simple modulus if you want to display as HH:MM in some report.

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

Sidebar

Related Questions

I have to write this line saying 10 Users have contributed 70 hours today
I have a form in witch users can add their working hours view them
I have users table and want to SELECT some rows by bitmask criteria. I'll
i have users table and i have posts table i want select from users
In my application I have Users, Organisations and Employees. There are domain objects for
Just want to get some views/possible leads on an issue I have. I have
I've been battling with this bug for 3 hours. I have checked the build
I'm building a time tracking system. Users would enter hours worked during the week.
I have four pivots I'm pulling data from that look like this: tracked_work_by_users_by_operation_pivot: +-------------------+---------------+---------------+-----------------------+---------------+
I have in my application.rb : config.active_record.default_timezone = :local What happens because of this,

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.