Skip to main content
Question

Select Datetime


sunsilk11
Contributor
Forum|alt.badge.img+6

@takashi

Hi I have a DESIGN_DATETIME field in SQL Server and an example of its value is 23/06/2019 11:21:01

I am trying to use TestFilter to return only records with timestample in the last 48 hours (i.e. 2 days)

The following doesn't seem to work. I am using FME 2018

DESIGN_DATETIME >= @DateTimeAdd(@DateTimeNow(),-P2D)

Any suggestion?

2 replies

takashi
Contributor
  • June 24, 2019

Firstly make sure that the value of DESIGN_DATETIME is formatted with the FME standard date/time format - i.e. %Y%m%d%H%M%S.


mark2atsafe
Safer
Forum|alt.badge.img+43

There was a recent question that I answered and it should help you. Basically convert the date (DateTimeFormatter) and use the DateTimeCalculator to subtract 48 hours from now (@DateTimeNow). Test if the result is more or less than zero to filter your data.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings