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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:03:57+00:00 2026-05-13T07:03:57+00:00

I am working on a issue tracking application with asp.net and sql server 2005.

  • 0

I am working on a issue tracking application with asp.net and sql server 2005. While tracking the issues I am storing the deadline as datetime in the database and also if someone posts a message in the message board the posting date/time is also getting stored in the db as datetime.

Now my requirement is to show the issue deadline as “2 days left” when only 2 days are left, just like that when the deadline is already over it sud display 2 days behind schedule. This I think could be achieved with sql server datediff(), but in case of the messages I need to show like posted by 2 hours 3 minutes ago….or posted by 3 days 18 hours ago or something similar…(we can eliminate the hours if it was posted even 1 day before).

Tried Google but could not find anything useful. Would; appreciate your kind help as always.

Thanks in advance.

  • 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-05-13T07:03:57+00:00Added an answer on May 13, 2026 at 7:03 am

    Use a variation on the following query, and adjust as needed. For other RDBMS’s replace the date functions with appropriate equivalents.

    SELECT  CASE
              WHEN DateValue-GETDATE() >= 1 THEN CAST(DATEPART(dy, DateValue-GETDATE()) AS varchar) + ' day(s) remaining'
              WHEN DateValue-GETDATE() >= 0 THEN CAST(DATEPART(hh, DateValue-GETDATE()) AS varchar) + ' hour(s) remaining'
              /*Note, it's convenient to switch around for negatives*/
              WHEN GETDATE()-DateValue <= '00:59' THEN CAST(DATEPART(mi, GETDATE()-DateValue) AS varchar) + ' minutes(s) overdue'
              WHEN GETDATE()-DateValue <= 1 THEN CAST(DATEPART(hh, GETDATE()-DateValue) AS varchar) + ' hours(s) overdue'
            ELSE
              CONVERT(varchar, DateValue-GETDATE(), 121)
            END AS Time_Scale
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 265k
  • Answers 265k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The syntax of a counter path is: \\Computer\PerfObject(ParentInstance/ObjectInstance#InstanceIndex)\Counter The Computer… May 13, 2026 at 12:29 pm
  • Editorial Team
    Editorial Team added an answer You can use a using block, which will automatically close… May 13, 2026 at 12:29 pm
  • Editorial Team
    Editorial Team added an answer yeah you can use metaWeblog.newPost or blogger.newPost, an example of… May 13, 2026 at 12:29 pm

Related Questions

I'm having an issue with CruiseControl.net where the web dashboard just won't work in
I am working on a project in eclipse that when I launch using the
I'm in the preliminary stages of designing a new web application, and have yet
I am using Visual Studio Team System 2008, version 9.0.30729.1 SP. I have a
How do you pass parameters in ASP.net MVC over two views, like a wizard?

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.