Forum Discussion
KareemMostafa12
3 years agoHelper I
Incremental refresh for MongoDB database
Will be happy if someone can help me 😔 i'm using MongoDB connected with PBI with BI connector to using ODBC DSN and every thing is working fine till now recently i tried to setup incremental refre...
lbendlin
3 years agoSuper User
that's not what I meant. How is MongoDB expecting it to be formatted? Can you show a sample SQL query?
KareemMostafa12
3 years agoHelper I
Is it what you mean
 
- lbendlin3 years agoSuper User
Yes. Change your Power Query to
DateTime.ToText(RangeStart,[Format="yyyy-MM-dd'T'HH:mm:ss'Z'"])and the same for RangeEnd.
- KareemMostafa123 years agoHelper I
where can i add this statement exactly?
- lbendlin3 years agoSuper User
let Source = Odbc.Query("dsn=MongoDB", "select * from groupshops where [createdAt]>='" & DateTime.ToText(RangeStart,[Format="yyyy-MM-dd'T'HH:mm:ss'Z'"]) & "' and [createdAt]<'" & DateTime.ToText(RangeEnd,[Format="yyyy-MM-dd'T'HH:mm:ss'Z'"]) & "'") in Source