Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Pass system date to parameter

hello,
how to pass system date to parameter ....

 

 

#date(2018, 4, 13) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]

 


regards

pooja Dhonde

  • Hi Anonymous,

     

    You could create a Blank Query by DateTime.LocalNow() in Query Editor to get the system time.

     

    Then you try to use this accessing data funtion below in the Advanced options when you get data from SQL Server Datebase.

     

    Sql.Database(server as text, database as text,  [Query = "select A from table where..." & "localtime"]) as table

     

    In Addition, you could have a good reference of DateTime.LocalNow() and Sql.Database.

     

    Best Regards,

    Cherry

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    #date(2018, 4, 13) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]

    hello,
    how to pass system date to parameter ....

     


    regards

    pooja Dhonde

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Is that a statement or a question?

     

    DateTime.LocalNow will give you the "system time"

    • Anonymous's avatar
      Anonymous
      Not applicable
      Hello,
      That is question not statement ..

      Can you explain more how to pass DateTime.LocalNow in advance editor for above query.

      Actually my database is SQL and I want to pass system date that time that will fetch data from database and will show on dashboard. I have created parameter but can I pass system date to that parameter???and how??


      Regards
      Poojad1



      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi Anonymous,

         

        You could create a Blank Query by DateTime.LocalNow() in Query Editor to get the system time.

         

        Then you try to use this accessing data funtion below in the Advanced options when you get data from SQL Server Datebase.

         

        Sql.Database(server as text, database as text,  [Query = "select A from table where..." & "localtime"]) as table

         

        In Addition, you could have a good reference of DateTime.LocalNow() and Sql.Database.

         

        Best Regards,

        Cherry