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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:14:16+00:00 2026-06-05T02:14:16+00:00

I have the following table projects . id title created_at claim_window 1 Project One

  • 0

I have the following table projects.

id title        created_at               claim_window
1  Project One  2012-05-08 13:50:09.924  5
2  Project Two  2012-06-01 13:50:09.924  10

A) I want to find the deadline with the calculation deadline = created_at + claim_window, where claim_window is the number of days. Something like following:

id title        created_at               claim_window  deadline
1  Project One  2012-05-08 13:50:09.924  5             2012-05-13 13:50:09.924
2  Project Two  2012-06-01 13:50:09.924  10            2012-06-11 13:50:09.924

B) I also want to find the projects whose deadline is gone:

id title        created_at               claim_window  deadline
1  Project One  2012-05-08 13:50:09.924  5             2012-05-13 13:50:09.924

I tried something like following, but it didn’t work.

SELECT * FROM "projects" 
WHERE (DATE_PART('day', now()- created_at) >= (claim_window+1))
  • 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-05T02:14:18+00:00Added an answer on June 5, 2026 at 2:14 am

    This will give you the deadline :

    select id,  
           title,
           created_at + interval '1' day * claim_window as deadline
    from projects
    

    Alternatively the function make_interval can be used:

    select id,  
           title,
           created_at + make_interval(days => claim_window) as deadline
    from projects
    

    To get all projects where the deadline is over, use:

    select *
    from (
      select id, 
             created_at + interval '1' day * claim_window as deadline
      from projects
    ) t
    where localtimestamp at time zone 'UTC' > deadline
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a project database in MSACCESS with the following tables: table PROJECTS with
I have the following scenario: a table of projects and a table of persons,
I have the following table structure, which is imported into an Entity Framework project:
I have the following table | id | title | parent | ------------------------ |
In my schema, I have a table Projects, and a table Tasks. Each project
I have the following structure for my project and developer program: developer table id
I have the following task. Having three models Project, User and PurchaseOrder. I want
In one of my projects I have the following situation: I have Availability Objects
In my news page project, I have a database table news with the following
I have following table where each row has a unique ID. Now I want,

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.