Look for PIVOT function if you are using SQL Server.
http://databaseandstorage.blogspot.com http://gotodba.weebly.com
Forum Rules