Friends,

I have data table which contains dates and states. Here is the sample.
Date | State
1/23 NV
1/28 PA
1/29 NY
1/30 NY
2/1 NY
2/3 TN
2/4 TN


I want to display them in ranges by states. Like

1/23 NV
1/28 PA
1/29 - 2/1 NY
2/3 - 2/4 TN


Can you help me in this regard?


Thank You

It is good to show some effort first. Please post what code you've tried so far.

Hint: You'll need MIN(), MAX() and GROUP BY


http://www.w3schools.com/SQl/sql_groupby.asp

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.