Ok, I think I understand your problem. You have to change my SQL generation query like this:
select 'create view MyHelperView as '
select 'select [name], [year], [date], '
+''''+table_name+''' as tablename from '+table_schema+'.'
+table_name+' union all '
This query generates a helper view that you can use in your program. It contains a new colum named "tablename" that you can display. Therefore your query could look like this:
select tablename, name from MyHelperView where date = ...
Hope this helps!
Visit my blog at http://www.cubido.at/rainers