Extract Last 12 months data if you have a Month_Code Column of the format 'YYYYMM'

SELECT * FROM REPORT_DATA
WHERE (MONTH_CODE >=
Replace(LEFT(CONVERT([varchar],dateadd(month,-1,getdate()) , 120), 7),'-','') )


Thanks to Dipendra Baghel who assited in framing this.

Comments

Carly Fiorina said…
Hi all,

Data extraction is the act or process of retrieving data out of data sources for further data processing or data storage. The import into the intermediate extracting system is thus usually followed by data transformation and possibly the addition of metadata prior to export to another stage in the data workflow. Thanks a lot.....

Free Web Scraping Software

Popular Posts