Skip to main content
Question

Select Datetime

  • June 24, 2019
  • 2 replies
  • 45 views

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7843 replies
  • 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+56
  • Safer
  • 2554 replies
  • June 24, 2019

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.