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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:58:53+00:00 2026-06-07T16:58:53+00:00

I am new to SQL and I know how to use filter in sql

  • 0

I am new to SQL and I know how to use filter in sql with decimal type, but this time I am working with string type.

  • I need to filter anything greater than “3 hrs” or “180 min”
  • I was able to get it to filter anything greater than “3 hrs”
  • But not able to filter anything greater than 180 mins

here is screenshot of output for this table.

enter image description here

Here is SQL select statement and it is working

SELECT EVENTID,
       STARTDATETIME,
       F_NAME,
       DURATIONHM,
       NUM_PEOPLE

  FROM EVENT_FACT
  where DURATIONHM > '3 hrs'
  • 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-07T16:58:54+00:00Added an answer on June 7, 2026 at 4:58 pm

    You can’t write the query the way that you want to. You need to store the duration in minutes, as a number, and then use:

    where duration >= 3*60
    

    You can, with a bunch of effort, create a view that parses the string to get the minutes. In some databases, you can also convert such a string into a time or interval data type, which gets you further along.

    However, what you have discovered is that storing the duration as a string does not meet the query requirements that you have on the field. (You would discover the same thing if you tried to order by duration.)

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

Sidebar

Related Questions

I'm new to PL/SQL and I'm trying to use a table of records, but
I don't know SQL Geospatial new feature. I'm wondering if I can use to
Does anyone know how to insert a new post into Wordpress using sql?
I need to create an entirely new Sql Server 2008 database and want to
I am new to SQL Server Report Builder 2.0 and I need to compare
So I am just getting started with this. New to .NET, SQL Server, C#,
I think it's kind of noob question but I'm new to SQL Server in
As a preface, I am brand new to using SQL Server 2005; I know
As you know we use LinQ Technology to SQL Classes for send and get
I am new to sql query optimization and i would like to know if

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.