Re: Sorting data to last 30 days

From: Myrna Larson (myrnailarson_at_chartermi.net)
Date: 06/30/04


Date: Wed, 30 Jun 2004 14:22:49 -0500

I think you should explore applying the filter to the SQL database so that
only the last 30 days records are exported.

There are problems with trying to use AutoFilter here: custom criteria don't
allow a formula like >TODAY()-30, but even it you could work around that
problem, the AutoFilter doesn't update automatically.

You could possibly use a macro to run the import and automatically change the
filter criteria. It could calculate the earliest date based on the current
date and set the criterion appropriately.

On Wed, 30 Jun 2004 11:17:02 -0700, "joemc911"
<joemc911@discussions.microsoft.com> wrote:

>That would probably work, but I want it to be a variable that allows for the
change in date ranges. I also don't want to have to change it at any point.
I simply want it to sort out the last 30 days and base that on the current
date. Not sure if it's even possible.
>
>"Alan" wrote:
>
>> Try using Data > AutoFilter > Custom > Greater Than or Equal to the Earlier
>> date
>> >Less Than or Equal to the end date
>> Regards,
>> "joemc911" <joemc911@discussions.microsoft.com> wrote in message
>> news:6EC27B8E-EA87-4C83-8E60-9E7938E67A3C@microsoft.com...
>> > I would like to be able to filter my data, which I get from an sql
>> database, to show only the records from the last 30 days. Is there a way
to
>> do this? I have an existing date in the record. Any help would be greatly
>> appreciated!
>>
>>
>>



Relevant Pages

  • Re: Help please with autofilter and dates
    ... The AutoFilter method of a Range object is a very curious beast. ... If we use "=", Excel matches on the text that is displayed in the cell, i.e. the ... create a criteria string that will locate an exact match in all locales. ... When using any of the other filter ...
    (microsoft.public.excel.programming)
  • RE: How Can I gets avaliable list of all criteria in autofilter
    ... "AutoFilter is the fastest way to extract the list using the criteria. ... can use the AdvancedFilter method to filter and simultaneously copy the list ...
    (microsoft.public.excel.programming)
  • Re: AutoFilter... not quite right
    ... I don't like to let excel guess my range to filter. ... The AutoFilter method of a Range object is a very curious beast. ... us to create a criteria string that will locate an exact match in all locales. ...
    (microsoft.public.excel.programming)
  • Re: AutoFilter... not quite right
    ... Dim ExactCriterion As String ... The AutoFilter method of a Range object is a very curious beast. ... us to create a criteria string that will locate an exact match in all locales. ... When using any of the other filter ...
    (microsoft.public.excel.programming)
  • Re: How Can I gets avaliable list of all criteria in autofilter
    ... "AutoFilter is the fastest way to extract the list using the criteria. ... can use the AdvancedFilter method to filter and simultaneously copy the list ...
    (microsoft.public.excel.programming)