>I have another brain freeze >I know the beginning year and month and the ending year and month (all integers) >I want to write a query that returns all rows with inv_dates between those months and years. >All graciously accepted.
WHERE inv_dates
BETWEENCONVERT(DATETIME,CAST(@fromyear ASVARCHAR(4))+'-'+CAST(@frommonth ASVARCHAR(2))+'-01',120) ANDDATEADD(m,1,CONVERT(DATETIME,CAST(@toyear ASVARCHAR(4))+'-'+CAST(@tomonth ASVARCHAR(2))+'-01',120))-1
MartinaJ
"Navision is evil that needs to be erazed... to the ground"