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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:05:04+00:00 2026-05-16T22:05:04+00:00

I have a table:: ItemID VersionNo CreatedDate ——————————- 1 3 7/9/2010 1 2 7/3/2010

  • 0

I have a table::

ItemID  VersionNo  CreatedDate
-------------------------------
1       3          7/9/2010
1       2          7/3/2010
1       1          5/3/2010
1       0          3/3/2010
2       0          4/4/2010
3       1          4/5/2010
3       0          3/4/2010

…where Version 0 means .. its a newly produced item. Here I need to find time,(time gap between two versions) and add a column as process time.
like::

ItemID  VersionNo  CreatedDate  ProcessTime
-------------------------------------------
1       3          7/9/2010     6Days or 6*24Hrs
1       2          7/3/2010     60Days 
1       1          5/3/2010     2Days
1       0          3/3/2010     ''
2       0          4/4/2010     '' 
3       1          4/5/2010     31Days
3       0          3/4/2010     ''

VersionNo’s are not Fixed..means with time, it could increase… How to acheive the desire result in MS Access or in SQL-Server.

Thanks in advance for all your sincere efforts.
Thanks

  • 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-16T22:05:05+00:00Added an answer on May 16, 2026 at 10:05 pm

    How about (Access):

    SELECT t.ItemID, 
           t.VersionNo, 
           t.CreatedDate, (
              SELECT Top 1 
              CreatedDate 
              FROM Versions v 
              WHERE v.ItemID=t.ItemID 
              And v.VersionNo<t.VersionNo 
              ORDER BY VersionNo DESC) AS LastDate, 
           DateDiff("h",[LastDate],[CreatedDate]) AS DiffHrs,
           DateDiff("d",[LastDate],[CreatedDate]) AS DiffDays
    FROM Versions t
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this three tables. Table: Item Columns: ItemID, Title, Content, NoChange (Date) Table:
I have table where all item names and their itemcodes are displayed. TableItem ItemID,
We have a table like this (simplified version): Items: Itemid Itemname Itemfatherid itemA theitemA
I have a table Item (ItemId int PK, Title vc, Description vc) I created
I have a table full of items that each have a unique ItemID .
I have a table with the following structure: itemId | direction | uid |
i have a table with the column id, itemID and locationId. i have now
Let's say I have a table like this in my DB Date ItemId Count
I have a table with a column I would like to update its values.
I have a table of metals MetalID integer MetalName text MetalCode text Item table

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.