To find if a given date is from previous month

Hi

I need to find out if a particular date which is stored in record type is from the previous month.  For example today in September I'm finding that 7th of August 2023 date (Already present in record type) is from August month.  How can I achieve this?  Please give me the suggestions.

Thanks.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to prachit0003

    Here's an example on how to calculate the start and end dates and how to create the queryFilter:

    a!localVariables(
      local!now: now(),
      local!endDate: eomonth(local!now, - 1),
      local!startDateTime: userdatetime(
        year(local!endDate),
        month(local!endDate),
        1,
        0,
        0,
        0
      ),
      local!endDateTime: userdatetime(
        year(local!endDate),
        month(local!endDate),
        day(local!endDate),
        23,
        59,
        59
      ),
      a!queryFilter(
        field: "timestamp",
        operator: "BETWEEN",
        value: { local!startDateTime, local!endDateTime }
      )
    )

Children