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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:26:13+00:00 2026-06-03T23:26:13+00:00

I have a time stored as a decimal(9,2) column in an sql-server 2005 database.

  • 0

I have a time stored as a decimal(9,2) column in an sql-server 2005 database.

The time is represented like
Time timeInDecimal
1H 20Min 1.33
1H 30Min 1.50
and so on

I´m looking for an easy way to check whether the number of minutes except whole hours is not evenly divided by 5.
The value I’m hoping to find is where the time is 1H:23Min but not 1H:25MIN.
I just wan´t to compare the minute part of the time.

The way I do now is:

RIGHT(CONVERT(varchar(5),DATEADD(minute,ROUND(timeInDecimal * 60,0),0),108),1) not in ('0','5')

But it does hardly seems to be the ideal way to deal with this.

Feels like I can use the modulo operator for this, but how?
Or is there an even better way?

Hope for a quick answer.
Kind Regards
Andreas

  • 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-03T23:26:14+00:00Added an answer on June 3, 2026 at 11:26 pm

    Using the modulus operator, twice:

    ROUND((timeInDecimal % 1) * 60, 0) % 5 <> 0
    

    That will:

    1. Get the fractional part and convert it to minutes.
    2. Round it to the nearest minute (.33 hours -> 20 minutes, not 19.80).
    3. Check whether that’s divisible by 5.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server database designed like this : TableParameter Id (int, PRIMARY
I am working on sql server monitoring product and i have database query that
We have SQL Server 2000 database with money data type columns and we have
I have date and time stored in my database as MySQL DATETIME datatype. While
I have a table containing view/click records. The time is stored in a unix
I'm writing reports on SQL Server Reporting Server that have a number of hours
I have the time stored as a fraction (done so it can be displayed
I have a application that stores passwords in a ms sql database, I wish
I have a temperature measurements stored in a table, each measure have actuall date/time
I have a time (without date component) like 9am, let's say it's the current

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.