DateAdd and other functions

  • Thread starter desolationstorm
  • Start date
D

desolationstorm

I have a Date Arrived and I need to add a certain number of days to that
date. Which I successfully did. Is there a way to have that infortaion be
saved to a field in my database so when queries were built down the road that
they would pull from that information.

I realize I could do a relationship and build queries so that it would pull
form that querie, but I need to do a number of calculations based around
dateadd and datediff and this needs to be simple for others to use.

Im trying to make it simple enough so people that don't know how to use
access only need to pull categories from a particular table and get the
information they want.
 
T

Tom van Stiphout

On Fri, 6 Nov 2009 01:52:02 -0800, desolationstorm

Couldn't you use an Update query:
update myTable
set myOtherDateField = DateAdd('d', 7, DateArrived)

-Tom.
Microsoft Access MVP
 
D

Dale Fye

Desolation,

The best way to do this for "people that don't know how to use access" is to
build an application (can be as simple as a single form) for them to "get the
information they want". The WORST thing you can do is expose your raw data
tables to people who don't know what they are doing.

Create a query that contains all the information you want your users to be
able to access. Then create some unbound text or combo boxes on your form,
and then filter the data based upon the users selections in those controls.
You can present the results in a listbox, or a subform that is configured as
a datasheet (locked), in a report, or maybe just a query that the users can
export to Excel.
 
J

John W. Vinson

I have a Date Arrived and I need to add a certain number of days to that
date. Which I successfully did. Is there a way to have that infortaion be
saved to a field in my database so when queries were built down the road that
they would pull from that information.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or in the control source of a Form or a Report
textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top