From: John W. Vinson on 15 Feb 2010 17:03 On Mon, 15 Feb 2010 12:13:01 -0800, oldblindpew <oldblindpew(a)discussions.microsoft.com> wrote: >Would this argue for using shorter field names? That, or alias the tablenames and fieldnames: rather than SELECT [LongTableNameA].[ThisIsABigFieldName], [LongTableNameB].[AnotherBigFieldName] FROM [LongTableNameA] INNER JOIN [LongTableNameB] ORDER BY [LongTableNameA].[ThisIsABigFieldName] you can use SELECT [A].[ThisIsABigFieldName] AS BigA, [B].[AnotherBigFieldName] AS BigB FROM [LongTableNameA] AS A INNER JOIN [LongTableNameB] AS B ORDER BY BigA; In a large many-field query with long fieldnames this can save you a whole lot of characters. Also, if a fieldname is unambiguous you don't need to qualify it with the tablename; i.e. instead of WHERE [LongTableNameA].[SomeUniqueField] = <criteria> just use WHERE [SomeUniqueField] = ... -- John W. Vinson [MVP]
From: oldblindpew on 16 Feb 2010 11:55 Thanks, John. I still don't know whether it is truly important to narrow the selection of fields. If it is (as I would think), and since field names tend to be somewhat lengthy despite our best efforts, then it seems odd being limited by the length of the string for a query. One would think by now there would be some sort of behind-the-scenes mechanism to circumvent this limitation. Thanks Again, Pew "John W. Vinson" wrote: > On Mon, 15 Feb 2010 12:13:01 -0800, oldblindpew > <oldblindpew(a)discussions.microsoft.com> wrote: > > >Would this argue for using shorter field names? > > That, or alias the tablenames and fieldnames: rather than > > SELECT [LongTableNameA].[ThisIsABigFieldName], > [LongTableNameB].[AnotherBigFieldName] > FROM [LongTableNameA] INNER JOIN [LongTableNameB] > ORDER BY [LongTableNameA].[ThisIsABigFieldName] > > you can use > > SELECT [A].[ThisIsABigFieldName] AS BigA, [B].[AnotherBigFieldName] AS BigB > FROM [LongTableNameA] AS A INNER JOIN [LongTableNameB] AS B > ORDER BY BigA; > > In a large many-field query with long fieldnames this can save you a whole lot > of characters. > > Also, if a fieldname is unambiguous you don't need to qualify it with the > tablename; i.e. instead of > > WHERE [LongTableNameA].[SomeUniqueField] = <criteria> > > just use > > WHERE [SomeUniqueField] = ... > -- > > John W. Vinson [MVP] > . >
First
|
Prev
|
Pages: 1 2 Prev: Pen Mode in Access 2007 Next: Can we put two or three sets of data into one combobox? |