Skip to Content
Former Member
May 19, 2015 at 07:27 PM

Crystal Reports Improperly Queries INSQL For Non-existant Tags


I bring in my database, it's the one from Wonderware Historian 2014 SP1 Runtime. This is made up by Wonderware and not me. When I do Select Top 1000 rows on the view, it fails out with the same error as in Crystal Reports. If I wipe the pseudo TagName that are automatically populated by SQL, and set my WHERE to something that is specifically in the database, then SQL works fine and returns the query. I realize I may have to reconfigure something in SQL, but I'm wondering if I can change some sort of first run query in Crystal Reports. This would allow me to fix the first query, since I didn't make the database, Wonderware did and is constantly updating and modifying it. Ideas?

The Select Top 1000 goes as following:

OLE DB provider "INSQL" for linked server "INSQL" returned message "History queries must contain at least one valid tagname".

Msg 7320, Level 16, State 2, Line 2

Cannot execute the query "SELECT Tbl1001.DateTime Col1004,Tbl1001.TagName Col1005,Tbl1001.Value Col1006,Tbl1001.vValue Col1007,Tbl1001.Quality Col1008,Tbl1001.QualityDetail Col1009,Tbl1001.OPCQuality Col1010,Tbl1001.wwTagKey Col1011,Tbl1001.wwRowCount Col1012,Tbl1001.wwResolution Col1013,Tbl1001.wwEdgeDetection Col1014,Tbl1001.wwRetrievalMode Col1015,Tbl1001.wwTimeDeadband Col1016 FROM Runtime.dbo.History Tbl1001" against OLE DB provider "INSQL" for linked server "INSQL".