Question

Select Datetime


Badge +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

Userlevel 2
Badge +17

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.

Userlevel 4
Badge +25

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