I have a form that creates a query on the fly. It works great, but has a problem with columns that have numeric names. The table is not mine so I can not change the columns. When I run the query the column name appears in the column. I tried to find anything wrong in the query and could not. IF I open the query in design mode and click on one of the numeric columns, the query starts to display properly. The table has columns for years from 1996 to the present.
Each column should be a boolean but is set up an integers.
Here is an example:
select 1996 from tblx
column 1996
row1 1996
row2 1996
once I open and touch the query it behaves properly.
select 1996 from tblx
column 1996
row1 0
row2 -1
If I do not open the query and run Object dependencies on the query it displays properly also
Software/Hardware used:
ASKED:
November 19, 2008 12:15 PM
UPDATED:
November 20, 2008 9:40 PM
Try putting your column in [ ]. This tells access that it is a column in a table and not reserved expressions.
Select [1996] from tblx
Yes, pre-fixing with [ ] will ensure it is col name. I do not think numeric col name to be problem. Or you may try on the Design mode … use Year:[1996] (to give a temporary col name Year)