Calculated Field

1987nac1987

New member
Local time
Today, 11:37
Joined
Sep 16, 2010
Messages
8
Hi there I'm very new to access and this is (hopefully) a simple question, maybe someone can help me out?

I would like to create a calculated field in a table that takes a date from that record and adds 30 days to it and stores that value.

How do I do that, then?! :D
 
You don't. Get a query to do it for you.
 
Hi there I'm very new to access and this is (hopefully) a simple question, maybe someone can help me out?

I would like to create a calculated field in a table that takes a date from that record and adds 30 days to it and stores that value.

How do I do that, then?! :D

Welcome to the forum,

You would need to create a query that looks at the datefield and then adds 30 days then use the result to update the field in the table,

So create a basic select query and an expression once checked out then convert the select query to an update query.
 
That's fantastic!
I'm already learning!

Where am I going wrong with this SQL statement, then please?

SELECT [NC Log].DateOpened, [DueDate] AS Expr1
FROM [NC Log]
WHERE (("DueDate:"=DateAdd("d",30,[DateOpened])));
 
'We' do not store calculated values in tables
'We' do not store calculated values in tables
'We' do not store calculated values in tables
'We' do not store calculated values in tables
'We' do not store calculated values in tables
 
I think your looking for:
SELECT [NC Log].DateOpened, [DueDate] AS Expr1, DateAdd("d",30,[DateOpened]) as NEWDuedate
FROM [NC Log]

Please have a look at naming conventions before you create yourself a night mare....
You shouldnt use spaces (or special characters) in any names
and you should use a prefix per object, ie. tbl, qry,frm for tables, queries and forms etc...
 
Unless you have Access 2010 which can have data macros (like triggers) you should NOT store that calculated data in the table. As namliaM stated, it is not a good idea to store calculated data in most cases (this being one of them because you have the date to be able to run the calculation in a query at run time when needed) as it is very easy for your data to become Out Of Synch if, for example, some date gets changed by someone by some other means from your form. So, your INTEGRITY of your data is definitely at risk.

So, why store it in the table anyway? You can use a QUERY for doing almost everything you can do with a table. So, storing it in a table is simply not needed, takes more overhead, and puts your data integrity at risk.
 

Users who are viewing this thread

Back
Top Bottom