Forum Discussion

suchitsanghvi's avatar
suchitsanghvi
Data Storage
03-28-2022

Retrieving only last weeks data using Custom SQL Query for Generic JDBC mongo connector

I am using Generic JDBC connector to import data from our MongoDB.
For certain requirements, I want to only import data from the past 7 days wrt the current date using the timestamp field present in the data.

I have tried a bunch of regular SQL functions like 'DATEDIFF' and 'DATE_SUB' but it seems like Custom SQL does not support these functions.

Is there any workaround or solution? Any help would be really appreciated, thanks!

1 Reply

Replies have been turned off for this discussion
  • Diane_Kostka's avatar
    Diane_Kostka
    Sisense Employee

    Hello!

    You would need to use the mongo supported function in the import queries to achieve the equivalent of the SQL function.  Please refer to this list of MongoDB supported functions

    Hope that helps!

    - Diane