【问题标题】:Date function not working on Label in PowerApps日期功能不适用于 PowerApps 中的标签
【发布时间】:2019-10-14 21:04:17
【问题描述】:

我有一个名为“testDateField”的下拉菜单和一个名为“testLabel”的标签。

在下拉列表中,我的数据为月/年。例如: 01/2019 02/2019 03/2019 04/2019 05/2019 06/2019 07/2019 08/2019 ... ...

现在,在 testLabel 中;我想使用以下公式:

Date(Right(testdatefield.SelectedText.Value, 4), Left(testdatefield.SelectedText.Value, 2), 1)

通过这个公式,我可以得到从下拉列表中选择的月份的第一天。

理想情况下,我应该在从下拉列表中选择 08/2019 时得到 08/01/2019。 示例 2:从下拉列表中选择 01/2019 时,我应该在标签中得到 01/01/2019。

任何帮助将不胜感激。

【问题讨论】:

    标签: powerapps powerapps-formula powerapps-canvas powerapps-selected-items


    【解决方案1】:

    functions Left and Right 返回一个文本值;要在Date 函数中使用它们,您需要将它们转换为数字,您可以使用Value function

    Date(
        Value(Right(Dropdown1.SelectedText.Value, 4)),
        Value(Left(Dropdown1.SelectedText.Value, 2)),
        1)
    

    【讨论】:

      猜你喜欢
      • 2019-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-27
      • 2021-07-26
      • 2015-03-31
      相关资源
      最近更新 更多