Update query using dates

L

lilbit27

I have a form where the user enters in a received date and other
information. Then another user will come in behind them research the
item that was entered and pend the item 15 days past the received date.

I am trying to use and update query to that will take the rcvd date and
add 15 business days and pend to the field call followupdate.

Does anyone know how I can do this? Right now if have:

field: fllwupdate
Table:Entries
updateto:[rcvddte] +15. This however includes weekends. I tried
DateAdd("ww",3,Now()) but that didn't work because its using today date
and not the received date.
 
T

tina

go to http://groups.google.com/advanced_search and search on "business days"
in the group "microsoft.public.access*" (without the quotes, in both
instances), you get back hundreds if not thousands of posts re this
question.

also suggest you do not store the followup date in the table at all. just
calculate it, in a query or on a form or report, whenever you need it.

hth
 
L

lilbit27

I need to store the date because later on the user will may to add 5
more days to the date the fllwupdate. I saw this site but it didn't
help me with what I was trying to do.
Wayne said:
For starters, I probably wouldn't save this date to the table. I would just
calculate it whenever I needed it. This can be done in a form, report, or
query.

To exclude weekends and holidays, see information here:
http://www.mvps.org/access/datetime/date0012.htm

--
Wayne Morgan
MS Access MVP


lilbit27 said:
I have a form where the user enters in a received date and other
information. Then another user will come in behind them research the
item that was entered and pend the item 15 days past the received date.

I am trying to use and update query to that will take the rcvd date and
add 15 business days and pend to the field call followupdate.

Does anyone know how I can do this? Right now if have:

field: fllwupdate
Table:Entries
updateto:[rcvddte] +15. This however includes weekends. I tried
DateAdd("ww",3,Now()) but that didn't work because its using today date
and not the received date.
 
W

Wayne Morgan

Do you track how many times the date is extended so that you know if you
have a problem developing?

Can the date only be extended one time? If so, just have a check box (yes/no
field) to extend the date. Again, this would allow for a calculation (date +
15 + 5 if box is checked).

The page I sent you to should help. Instead of just adding 15 days, you'll
need to create a module and place the functions from that page in them.
Then, you will need to call those functions to get a valid date. The
functions can be called from within a query. The functions will determine if
the date 15 days later is a weekend or holiday and will move the date to the
next workday if necessary (the function dhNextWorkdayA does this). There is
more than one function on that page. Pick the one that does what you need.

--
Wayne Morgan
MS Access MVP


lilbit27 said:
I need to store the date because later on the user will may to add 5
more days to the date the fllwupdate. I saw this site but it didn't
help me with what I was trying to do.
Wayne said:
For starters, I probably wouldn't save this date to the table. I would
just
calculate it whenever I needed it. This can be done in a form, report, or
query.

To exclude weekends and holidays, see information here:
http://www.mvps.org/access/datetime/date0012.htm

--
Wayne Morgan
MS Access MVP


lilbit27 said:
I have a form where the user enters in a received date and other
information. Then another user will come in behind them research the
item that was entered and pend the item 15 days past the received date.

I am trying to use and update query to that will take the rcvd date and
add 15 business days and pend to the field call followupdate.

Does anyone know how I can do this? Right now if have:

field: fllwupdate
Table:Entries
updateto:[rcvddte] +15. This however includes weekends. I tried
DateAdd("ww",3,Now()) but that didn't work because its using today date
and not the received date.
 

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