SQLTeam.com | Weblogs | Forums

Power BI - SQL Query to pull last 3 months

Hi there,

Sorry if this may seem straight forward as I'm still a noobie with SQL.

I currently have my Power BI pulling data from Service Now via an ODBC.

I'd like to run a script that only pulls 3 months of data from whatever the current date is from a table.

I've tried using the created field name 'SELECT columns FROM table WHERE sys_created_on >= now () - 90. However this didn't return any values in the table.

Thanks in advance!
Mike

Your issue is not related to Microsoft SQL Server which this forum is for. But that said you should probably be looking for postgreSQL NOW() function if SN's back end is postgreSQL

WHERE date >= sys_created_on - interval '90' day;