clear all
set more off
input ///
houseid year month
223 1997 1
223 1997 2
223 1998 1
223 2000 1
223 2000 2
223 2000 3
448 2000 2
448 2000 3
end
list
bysort houseid (year month): keep if year[1] == 2000 & month[1] == 2
list
keep
will delete unwanted observations. Instead, you could also mark the subsample of interest and work with that. For example
bysort houseid (year month): gen ok = year[1] == 2000 & month[1] == 2
<some command> if ok
For more advanced date manipulations try working with date variables. See for example
http://www.stata.com/help.cgi?dates_and_times
http://www.stata.com/support/faqs/data-management/handling-date-information/