Workflow Soluiton

 View Only
  • 1.  Getting Last Calendar Month

    Posted Oct 15, 2014 10:47 AM

    I have a process that searches a db and returns records based on user chosen date filters.  One of the date filters I need is "last calendar month".  For example if the search is done any time in October, the "last calendar month" will return all records from September.

    The only thing I have been able to do is to get the rolling total of the last month which, if I search today, would give me all results between Sept 15th, and October 15th, which isn't what we need.

    I know there are a lot of date components, and there must be some way to combine them in order to filter records from the last calendar month.

    Any tips?

    Also, how would I convert a "Date Greater Than" component into a "Date Greater than or Equal To" component?

     

    Thanks.



  • 2.  RE: Getting Last Calendar Month

    Posted Oct 15, 2014 11:09 AM

    What does your SQL query look like?

    You could just use DATEPART(MONTH, [DateColumnHere]) = [MonthHereByNumber]

    So for example,

    "where DATEPART(MONTH, [StartDate]) = 9 "

    would return anything with the month value of September.

    It may be easier to do it this way, but you could do it in workflow as well by using Get Month and comparing your month data that way, then filtering it.



  • 3.  RE: Getting Last Calendar Month

    Posted Oct 15, 2014 11:16 AM

    Thanks Andrew, I have one SQL query that grabs all records from two different databases, then within Workflow I join them and deal with filtering them based on user defined date ranges, so I think I will have to try and proceed using Get Month and comparing month data...

    Do you know how to make a "Greater than or equal to" functionality for dates?

    Thanks again.



  • 4.  RE: Getting Last Calendar Month

    Posted Oct 15, 2014 12:55 PM

    1st question: There's a Date Range Rule you can use, tho I see that it goes in hard Day increments only I think... I can't think of any other way but to get the month of the date, subtract one, and go from there.

    2nd question: For <=/>=, you can use DateDiff component (https://www-secure.symantec.com/connect/articles/date-difference) and check if result is 0 or negative via a Number Range Rule (or 0 and positive, forget which direction it's supposed to go)



  • 5.  RE: Getting Last Calendar Month

    Posted Oct 17, 2014 11:41 AM

    Thanks Reecardo, but with the Number Range Rule, if I enter 0 as a value, it gives me two output paths: "Less than 0" and "Greater than 0".  How do I create an option for equal to 0?  I tried putting in 0 twice, but is wouldn't accept duplicates.

     

    Thanks.



  • 6.  RE: Getting Last Calendar Month

    Posted Oct 17, 2014 11:43 AM

    Oops, never  mind I just found it, I needed to set the "Handles Equals by" to "Make Explicit".