🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

SQL DB data source: Need to pull data by the previous calendar month

User: "michele_adamski"
Altair Community Member
Updated by michele_adamski

Hi all, I'm new to developing in Monarch and need a little help. 

I need to create a report, pulling data from a SQL DB.

I’ve connected to the DB, located the correct tables and columns, and created the sort and saved the workspace.

However, I need to pull data by the previous calendar month and I don’t see an option to set a date by a variable. Is this something that can happen?

 image

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "CPorthouse"
    Altair Employee
    Accepted Answer
    Updated by CPorthouse

    Are you looking to pull data from the previous 30 days or dates from the previous month?  For instance, if you take today's date 4/21/2021, do you need the data from 3/22-4/21/2021 or all days from March 2021?

    Either case, you will most likely need to use a query and a WHERE clause to get the data you are looking for.  To get the last 30 days you could add this to the end of the query statement that DPS generates:

    WHERE CreatedDateTime >= DATEADD(DAY,-30, GETDATE())

    The above says to get any row where CreatedDateTime is within the last 30 days.