I have a table like this:
CustID VisitTime
1 2012-12-31 11:59
1 2013-1-1 00:00
1 2013-1-1 00:05
2 2013-1-1 00:20
2 2013-1-1 10:00
3 2013-1-1 11:40
Now, I want to choose those new customers whose visited the site from Jan 1st 12:00AM
to Jan 31st 11:59pm
.
For example: cust ID 1
also visited in Dec
, hence cust ID 1
should not be selected. Only 2
and 3
should be selected.
How do I incorporate this logic using t-sql
?