Adam
Adam

Reputation: 2455

Calculated Columns in Access

I have two columns in a table (Access DB):

I would like to define a third column in a table which calculates the difference in days taking the difference between the above mantioned dates. What is the best practice to do this in Access?

Thank you!

Upvotes: 0

Views: 209

Answers (2)

DrL
DrL

Reputation: 320

Using SQL:

Select [{YourTableName}]![Open_Date]-[{YourTableName}]![Closed_Date] 
as {whatever you want to name the calculated field} from [{YourTableName}];

Upvotes: 2

Gustav
Gustav

Reputation: 55806

Use a query:

Select 
    Open_Date, 
    Closed_Date, 
    DateDiff("d", Open_Date, Closed_Date) As Days
From 
    YourTableName

Upvotes: 2

Related Questions