Rolling Dates Forward

B

Bryan Harrington

Ok.. so I've got this web based application running with an Access 2k
database in the back end. It's a demo system that has dates in the tables.
Does anyone have a good suggestion on how to programatically roll the dates
forward by one date every day?

Thanks!
 
S

Simon Harris

To always store the current data in the table, set the default value to
'date()' (No quotes)

If you want to update existing data you'll need to run a query:

The following will update ALL records...
UPDATE TABLENAME SET FIELD NAME = Date()

Or add some criteria to update only certain records...
UPDATE TABLENAME SET FIELD NAME = Date() WHERE MYCOLUMNNAME > 1

Hope that helps.
 
B

Bryan Harrington

Thanks Simon.. right idea.. but not quite.

I have data in the table(s) already.. I want to be able to programatically
roll the dates forward by a day. The web based system automatically does
aging based on dates, but for the demo we'd like to always have a constant.
 
B

Bryan Harrington

OK.. sometimes you need to get up and walk away for a minute..

Thanks Simon.. with a little more brain power I figured it out.

UPDATE a_action SET a_action.action_date =
DateAdd("d",1,[a_action].[action_date]), a_action.fu_date =
DateAdd("d",1,[a_action].[fu_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