delete records that are older than a certain date 
Author Message
 delete records that are older than a certain date

Hi,

wonder if anyone can help me figure out what's wrong with this statement. I
get a data type mismatch in criteria expression error. The date is formatted
as yy-mm-dd...

SET remove = conn.execute("DELETE * FROM table WHERE removedate <
'"&now&"'")

Thanks!

Linda



Fri, 05 Sep 2003 21:25:39 GMT  
 delete records that are older than a certain date
Linda,

if you use Access you need to set # around the value for the date instead of
's

/Lasse


Quote:
> Hi,

> wonder if anyone can help me figure out what's wrong with this statement.
I
> get a data type mismatch in criteria expression error. The date is
formatted
> as yy-mm-dd...

> SET remove = conn.execute("DELETE * FROM table WHERE removedate <
> '"&now&"'")

> Thanks!

> Linda



Fri, 05 Sep 2003 22:23:09 GMT  
 delete records that are older than a certain date
Figured it out myself...

SET remove = conn.execute("DELETE * FROM table WHERE removedate <= #"&date -
1&"#")

if anyone's interested...

/Linda



Quote:
> Hi,

> wonder if anyone can help me figure out what's wrong with this statement.
I
> get a data type mismatch in criteria expression error. The date is
formatted
> as yy-mm-dd...

> SET remove = conn.execute("DELETE * FROM table WHERE removedate <
> '"&now&"'")

> Thanks!

> Linda



Fri, 05 Sep 2003 22:31:16 GMT  
 delete records that are older than a certain date
Linda,

skip the "Set remove="  it's not necessary to create a new object in that
case..

/Lasse


Quote:
> Figured it out myself...

> SET remove = conn.execute("DELETE * FROM table WHERE removedate <=
#"&date -
> 1&"#")

> if anyone's interested...

> /Linda



> > Hi,

> > wonder if anyone can help me figure out what's wrong with this
statement.
> I
> > get a data type mismatch in criteria expression error. The date is
> formatted
> > as yy-mm-dd...

> > SET remove = conn.execute("DELETE * FROM table WHERE removedate <
> > '"&now&"'")

> > Thanks!

> > Linda



Fri, 05 Sep 2003 22:41:39 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. FileSystemObject and deleting files that are older than a certain timestamp

2. ms-access - delete old dates and change dates

3. Delete old records ?

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

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

6. Deleting files and folders older than a particular date

7. Deleting log files older than current date

8. deleting logfiles older than current date

9. procedure to find certain files from a certain date on harddisk

10. Oldest Record between 2 Dates

11. Getting a Record of oldest date using SQL

12. deleting files which are older than certain dates/days.

 

 
Powered by phpBB® Forum Software