This is very helpful. Thanks. I have a question though. I am trying to use the INTNX function to get the first and last days of the previous month. How best can this be written? I need to use this in a where clause on DI Studio. The SQL code is "where fac.VALID_FROM_DTTM between DATEADD(m,-1,DATEADD(m, DATEDIFF(m,0,GETDATE()),0)) and EOMONTH(dateadd(month,-1,getdate()))"