Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Change date format in query

For a automated reppord i want to change the date in my url to the first day of the previouse month and the last day of the previuouse month. I got it to work with this querry but the url is still no...
  • v-alq-msft's avatar
    5 years ago

    Hi, Anonymous 

     

    You may modify your query as below to see if it helps.

    let 
        start = Date.ToText( Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd" ),
        end = Date.ToText( Date.StartOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1 )),"yyyy-mm-dd"),
        ...
    in
        ...

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.