Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 12:57 AM
Cillies
Guest
 
Posts: n/a
Default Manipulating Date

Does anyone know if it is possible to manipulate a date field, to
change on a daily basis.


i.e.
I want to know if you can update a date field so that all dates in the
database that have dates before todays date can be automatically
updated to todays date.

This would happen on a daily basis.

Kindest Regards
  #2  
Old November 13th, 2005, 12:57 AM
Douglas J. Steele
Guest
 
Posts: n/a
Default Re: Manipulating Date

UPDATE MyTable
SET MyDateField = Date()
WHERE MyDateField < Date()

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Cillies" <lee@prologic.ie> wrote in message
news:ba262325.0406180716.4a62d7ee@posting.google.c om...[color=blue]
> Does anyone know if it is possible to manipulate a date field, to
> change on a daily basis.
>
>
> i.e.
> I want to know if you can update a date field so that all dates in the
> database that have dates before todays date can be automatically
> updated to todays date.
>
> This would happen on a daily basis.
>
> Kindest Regards[/color]


  #3  
Old November 13th, 2005, 12:58 AM
devdex.com
Guest
 
Posts: n/a
Default Re: Manipulating Date



Do I place that code in the SQL of the Query for the form.

If so Do I place it before or after the FROM clause

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4  
Old November 13th, 2005, 12:58 AM
Douglas J. Steele
Guest
 
Posts: n/a
Default Re: Manipulating Date

That IS the SQL for the query.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"devdex.com" <anonymous@devdex.com> wrote in message
news:40d3140f$0$16447$c397aba@news.newsgroups.ws.. .[color=blue]
>
>
> Do I place that code in the SQL of the Query for the form.
>
> If so Do I place it before or after the FROM clause
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


  #5  
Old November 13th, 2005, 12:58 AM
Salad
Guest
 
Posts: n/a
Default Re: Manipulating Date

devdex.com wrote:[color=blue]
>
> Do I place that code in the SQL of the Query for the form.
>
> If so Do I place it before or after the FROM clause
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]

You could create a query like Doug showed. You need to change the Table
and field names to reflect the table/field in your database.

It depends on when you want to update the dates. You could call the
query from an autoexec macro (read help on how to create a macro) which
will fire when you open the database.
Let's say the query is called UpdateDates. You could also enter a
command like
Currentdb.Execute "UpdateDates"
in the OnOpen event of the form that loads when you open the application.



  #6  
Old November 13th, 2005, 12:58 AM
Pieter Linden
Guest
 
Posts: n/a
Default Re: Manipulating Date

lee@prologic.ie (Cillies) wrote in message news:<ba262325.0406180716.4a62d7ee@posting.google. com>...[color=blue]
> Does anyone know if it is possible to manipulate a date field, to
> change on a daily basis.
>
>
> i.e.
> I want to know if you can update a date field so that all dates in the
> database that have dates before todays date can be automatically
> updated to todays date.
>
> This would happen on a daily basis.
>
> Kindest Regards[/color]

Write as many queries as you need to in order to update all of the
tables you need to update. Then create an AutoExec macro and call the
update queries from there.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles