BLOG

02/01/2013

A Better Query - Common Field Names

A recent discussion about why an Aeries query was returning the wrong results highlighted a potential problem that even the most experienced Aeries query writers fall prey to: many Aeries tables have common field names. There are many occurrences of DT (Date), GR (Grade), TY (Type), TG (Status Tag), ED (usually enter date), U1, 2, 3, etc. and several other fields. The way to make sure that Aeries query picks the right field is use the table-dot-field format in your query statement, i.e., STU.GR, CON.CD, CRS.TG. This forces Aeries query to look at the specified field. The key is remembering that your query may look at a field you are not even aware of if you are not specific.

If you write MS Access queries or SQL queries, this becomes less of a problem because Access and SQL Management Studio will force you to pick a table before the query runs, but you need to make sure you choose the right table.

Chuck Berridge
Implementation Manager
Eagle Software
Orchard.DisplayManagement.Shapes.Shape