Skip to main content

Hello I am new to FME and I am trying to bring in spatial data from SQL server by adding where clause in the reader using function "SQL to Run before Read". I am not sure what query do I use?I am using the following statement but it is giving error.

select * from SDEDBO.Services where
Date>=Dateadd('day', GETDATE(),-30)

thanks for your help!

You should probably use the "WHERE clause" setting and not the "SQL to Run before Read":


Looks the syntax for the Dateadd function is wrong. Check here: DATEADD (Transact-SQL)

I think the WHERE clause should be:

Date >= Dateadd(dd, -30, GETDATE())

Where clause worked with this query

Date >= Dateadd(dd, -30, GETDATE())

Thank you for your help!


Reply