ms-access - delete old dates and change dates 
Author Message
 ms-access - delete old dates and change dates

Has anyone an example they could give me to delete old date from an ms -
access (97) database , as well as use the existing dates from a data base
and redate them using the current date - I am using it for a schedule.

As well I could use some help copying a database from one name to another
and overwrite the other file using V.B.

Thanks in advance for any input.

Rick



Thu, 31 Jan 2002 03:00:00 GMT  
 ms-access - delete old dates and change dates

Quote:

> Has anyone an example they could give me to delete old date from an ms -
> access (97) database , as well as use the existing dates from a data base
> and redate them using the current date - I am using it for a schedule.

> As well I could use some help copying a database from one name to another
> and overwrite the other file using V.B.

> Thanks in advance for any input.

> Rick

I'd be intrested in seeing your schedule code as I'm trying to do something
in that line at the minute - Your problems sound familiar :-)
Deleting dates I think I can do - offhand I'm not sure but I think you can do
something with datediff -
I think this is clumsy but it should work
Choose the date you want records before removed
(Assuming your database is  sorted by date)
then compare this date backwards from the first using date diff
and remove all records prior to the first negative (constantly checking for a
negative)
I'll hoke the code out tonight if I can find it

Andrew



Sat, 02 Feb 2002 03:00:00 GMT  
 ms-access - delete old dates and change dates

Quote:
>I think this is clumsy but it should work
>Choose the date you want records before removed
>(Assuming your database is  sorted by date)
>then compare this date backwards from the first using date diff
>and remove all records prior to the first negative (constantly checking for a
>negative)

It would probably be easier and faster to allow the database to do it by
sending it a DELETE statement:

"DELETE FROM tblItems WHERE itm_dteScheduled <= #08/17/1999#;"

-or-

"DELETE FROM tblItems WHERE itm_dteScheduled BETWEEN #08/01/1999# AND
#08/01/1999#;"

Note:  The syntax may not be perfect, but this would be the general idea of the
query.

-Curtis Spendlove
-Solstice Software



Sat, 02 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MS-ACCESS query date problem + date formatting in datagrid

2. deleting date-field in vb6 with ms access

3. How do I store an empty date on a date field (MS Access)

4. Script to delete files older than a specific date in a directory

5. delete records that are older than a certain date

6. delete a date in a bounded date field

7. delete a date in a bounded date field

8. delete a date in a bounded date field

9. delete a date in a bounded date field

10. Changing a Calculate field (Date) depending on Current date

11. need VB to Delete a date from an Access DB

12. Date - date = date

 

 
Powered by phpBB® Forum Software