SQLTeam.com | Weblogs | Forums

Out of date range


#1

Hi

I am trying to construct an SQL query regarding difference in date ranges – looking for errors.

MemberID, Check, Date,
01 1 2015-1-01
01 2 2015-6-01
01 3 2015-1-01

As you can see this person has a wrong date entry’s. It a query I wish to make to return id’s with date range errors like this

Any ideas please?


#2

Sorry, I don't see that. Which line is wrong ? How is it consider wrong ?


#3

data shows

MemberID, Check, Date,
01 1 2015-1-01
01 2 2015-6-01
01 3 2015-1-01

but as you can see in question check 2 has a date in June and not January

ideally all lines should read

MemberID, Check, Date
01 1 2015-1-01
01 2 2015-1-01
01 3 2015-1-01

please help


#4

The date should ALWAYS be identical for a given MemberID?

Or they should be in same-or-increasing-date-order by the Check column?

If the first it would be better to move the date out of that table rather than duplicate it on each row (i.e. Normalisation)


#5

Moved topic to Transact-SQL.