Solomon911
New Member
- Joined
- May 8, 2013
- Messages
- 8
This question is a little off topic but the users on this form have helped me out a lot with my VBA so I was hopeful someone could answer an SQL question.
My company uses a SQL server to log all of the events that happen on a piece of equipment every day. Each day the server creates a new table and with every event a new record is added. Needless to say there are a lot of tables. The query we use to view the events must be updated every day. Is there any way to change the “from dbo.Data_1Jan2015” to something that would equate to newest table.
use DOGHistory select distinct * from dbo.Data_1Jan2015 where type = 'Digital' order by edit_date
My company uses a SQL server to log all of the events that happen on a piece of equipment every day. Each day the server creates a new table and with every event a new record is added. Needless to say there are a lot of tables. The query we use to view the events must be updated every day. Is there any way to change the “from dbo.Data_1Jan2015” to something that would equate to newest table.
use DOGHistory select distinct * from dbo.Data_1Jan2015 where type = 'Digital' order by edit_date