Skip to main content
Solved

Bringing in Data for past 30 days from SQl server using SQL to run before read

  • November 3, 2017
  • 3 replies
  • 211 views

Forum|alt.badge.img

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!

Best answer by david_r

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

View original
Did this help you find an answer to your question?

3 replies

david_r
Celebrity
  • Best Answer
  • November 6, 2017

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


takashi
Influencer
  • November 6, 2017

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())

Forum|alt.badge.img
  • Author
  • November 6, 2017

Where clause worked with this query

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

Thank you for your help!


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