Select from a definable time window instead of string comparison