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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:06:54+00:00 2026-06-16T22:06:54+00:00

In my database sqlite I have a column with float numbers and times stored

  • 0

In my database sqlite I have a column with float numbers and times stored as strings, why when I try to order them with this query

select... order by cast("+filter+" as real)

return my numbers column with this wrong sequence:

    22,5
    23
    23,5
    23
    23,5
    24,5
    24

or my times column also with this wrong sequence:

00:56
00:57
00:52
00:46
  • 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-16T22:06:55+00:00Added an answer on June 16, 2026 at 10:06 pm

    Try

    select... order by cast(replace("+filter+",',','.') as real)
    

    Sqlite expects dot, not comma, as a fraction part separator. It also silently ignores unconvertable tail, so ‘24,5’ is converted to 24.0.

    As of your times column, it will be sorted well if you sort it as string, without casting to float. But if you want to cast it for some reason, you may turn colons into dots with replace.

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

Sidebar

Related Questions

I have this error: 12-07 15:27:11.567: E/AndroidRuntime(15797): Caused by: android.database.sqlite.SQLiteException: no such column: recipient:
I have a table in SQLite database of Android which has a column RANK
I need to modify a column in a SQLite database but I have to
I have an SQLite database. I created the tables and filled them with a
I'm updating an sqlite database to have a new column bin that is filled
I have an Sqlite database in which I want to select rows of which
All tables in the database have one timestamp column [ float ] followed by
I have 10 mb database and this code: cursor = mDatabase.query(CitySQLiteHelper.TABLE_CITIES, ALL_COLUMNS, null, null,
I have an sqlite database on android created like this: sqlite> .schema CREATE TABLE
I have an sqlite database that has a blob column with blob data. I

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.