Filters and Stored Procedure

Certified Associate Developer

I am exporting data from DB and storing into excel , in Export DSE to Excel smart service i need to add filters which will only export data for last month . How can i add this filtter to it .

One Stored Procedure need to create which will delete the dats for last month after fetching from DB . How to create this for 2 different entities which will delete data for last month.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Prakash

    a!localVariables(
      local!endOfMonth: eomonth(now(), 0),
      local!splittedDate: split(local!endOfMonth, "/"),
      local!endDateWithTime: datetime(
        local!splittedDate[3],
        local!splittedDate[1],
        local!splittedDate[2],
        "23",
        "59",
        "59",
        "59"
      ),
      a!queryLogicalExpression(
        operator: "AND",
        filters: {
          a!queryFilter(
            field: "createdOn_dtm",
            operator: "<",
            value: local!endDateWithTime
          ),
          a!queryFilter(
            field: "createdOn_dtm",
            operator: ">",
            value: datetime(year(now()), month(now()), 1, 00, 00, 00, 00)
          )
        }
      )
    )

Children