Skip to main content
Question

Formatting Date in FeatureWriter Query

  • December 19, 2023
  • 1 reply
  • 50 views

garbadek
Contributor
Forum|alt.badge.img

I have a SQL Server table that holds log information. It contains a date field. If I query it in SQL no problem I get: imageIn FME I have a FeatureWriter. I have it set to Update and Use Existing and I've chosen Where Clause as my row selection method. I thought it would be easy to select all rows having todays date, but I'm 3 hours in and having zero luck.

I've tried all sorts of iterations like these and many, many more and every time I get "date is incompatible with some data type" or it finishes successfully and I get zero matches. imageAny suggestion would we GREATLY appreciated.

Kim

1 reply

garbadek
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • December 19, 2023

Of course right after I post I find the answer:

 

"RunDate" = @DateTimeFormat(@DateTimeNow(),'%Y-%m-%d')

 

My dates in SQL were formatted no time and YYYY-MM-DD.

 

I'm guess it's so hard because their are so many possible date variations in terms of formatting, date/time, time zone, etc. and you are going between FME standard date format and whatever format your using in SQL (or whatever database you are using).

 

 

 


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