Hi

I agree with poul, save your last run in a text file or a database read the 
walue next time you run the program, then you dont have to run every monday 
but can change the day if somthing go wrong

I have a system using this, running every night and saving the init 
parameters to a access database in this version, but in the first version 
just to a text file. the advantaged of using a database is that this way you 
alsoe save the history

but to your quistion, we can get any day in the past or future using the 
below tcl expression

clock format [clock scan "-7 day" -base  [clock seconds]] -format "%Y %m %d"

you can find the documentation for this command at 
http://jamesthornton.com/tcl/8.4.2/TclCmd/clock.htm


have fun
peter laulund


>From: Paul Ramsey <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [fme] Advice about querying records based on date?
>Date: Mon, 20 Mar 2006 13:40:12 -0800
>
>Steve,
>
>Rather than assuming FME will be run exactly every week, you should
>set up so that all records since the *last run* are pulled.  As a
>side effect, this makes constructing your query easier too (no date
>math required).
>
>Have an include file which has something like
>
>MACRO START_DATE 20060101
>
>in it.  Construct your SQL using a [date] > $(START_DATE) and [date]
>< $(END_DATE) where you generate END_DATE off the system clock.
>
>Finally, the coup de grace.  At the end of your script, run a little
>TCL routine that overwrites your include file with a new include
>file, that has the current time (END_DATE) in the START_DATE.
>
>Now you can run your script weekly, hourly, daily, monthly, whatever,
>and it will always pull all outstanding records.
>
>P
>
>On Mar 20, 2006, at 12:52 PM, Steve Nelson wrote:
>
> > Anyone have some advice on how to tackle the following....
> >
> > I'm querying an Access database, I have an FME set up that makes some
> > selections based on certain factors, etc.. but what I'd like to do is
> > have this FMW run every week, but when it runs, to only spit out
> > records that were entered that week.
> > So if I set the FME to run every Monday morning, I'd like it to only
> > output records entered from the previous Monday, until the day before
> > (Sunday).  Is there a way to query or test and filter date fields in
> > FME?
> > My original thinking was to use the date stamper and then just
> > subtract 7 days from the stamped date, but not really sure what to do
> > if the FME runs on say, Monday January 2nd (20060102).  How do I get
> > it to select records entered between December 26th 2005(20051225) and
> > january 1st 2006 (20060101)??
> >
> > Any suggestions on how to get started are appreciated.
> > Steve
> >
> >
> >
> >
> >
> >
> >
> >
> > Get the maximum benefit from your FME, FME Objects, or
> > SpatialDirect via our Professional Services team.  Visit
> > www.safe.com/services for details.
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
>
>
>Get the maximum benefit from your FME, FME Objects, or SpatialDirect via 
>our Professional Services team.  Visit www.safe.com/services for details.
>Yahoo! Groups Links
>
>
>
>
>
>

_________________________________________________________________
Opret en personlig blog og del dine billeder på MSN Spaces:  
http://spaces.msn.dk






Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our 
Professional Services team.  Visit www.safe.com/services for details. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/fme/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to