wow it work tnx for the helpsee this it from your codeis okselect [na],[empid], date_start = case when start_date < DATEADD(m ,1,GETDATE()-DAY (GETDATE()) + 1 ) then DATEADD(m ,1,GETDATE()-DAY (GETDATE()) + 1 ) else start_date end ,date_end = case when end_date > DATEADD(m ,2,GETDATE()-DAY (GETDATE()) + 1)-1 then DATEADD(m ,2,GETDATE()-DAY (GETDATE()) + 1)-1 else end_date endfrom testdatewhere start_date <=DATEADD(m ,2,GETDATE()-DAY (GETDATE()) + 1)-1and end_date >= DATEADD(m ,1,GETDATE()-DAY (GETDATE()) + 1 )