Please advise how I can keep a subset of data using "date variable": i.e. keeping data from 27 Feb 2006 and 16 July 2006 (inclusive)

Tried this and obviously didn't work:

keep if allegdate >="27feb2006" & <="16jul2006"