paraphs just post ... calculate for deletion 6 month back

User avatar
sal21
PlatinumLounger
Posts: 4368
Joined: 26 Apr 2010, 17:36

paraphs just post ... calculate for deletion 6 month back

Post by sal21 »

i need to delete all records based six month back based current month and year...

in this case all <01/09/2015

note:
field is named DATE1 (shorth date dd/mm/yyyy)
I use vb6 and access and ado

User avatar
HansV
Administrator
Posts: 78589
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: paraphs just post ... calculate for deletetion 6 month b

Post by HansV »

Why is "six months back" <01/09/2015?
Best wishes,
Hans

Mark L
3StarLounger
Posts: 331
Joined: 11 Feb 2010, 03:55
Location: Land O Lakes, FL

Re: paraphs just post ... calculate for deletion 6 month bac

Post by Mark L »

BTW, you said "field is named DATE1 (shorth date dd/mm/yyyy)". In case you may not understand Date fields, they are actually Date/Time fields. A "short date" is merely a format, it is not a data type.

Also, if you plan on entering a specific date (such as deleting all records where Date1 is before July 1, 2016), I think you need to use "...WHERE Date1<#07/01/2016#". I'm not 100% sure about this, but I think if you use the # to define a date, Access expects this to be in mm/dd/yy (or /yyyy) format, even though you may normally express this date as 01/07/2016. Instead, you might use something like "...WHERE Date1 < Date()-180".
Mark Liquorman
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.