Ugg!! first coice is to rebuild the table
second choice I found that wrapping the offending field name in [ ] worked with ODBC and OLE but I am not sure how this will workd with DBI? something like this SELECT * FROM taskhours_per_date WHERE [EMPLOYEE NAME] = 'NAME HERE' might work option three Create a number of select querries on the access DB without the the spaces, Been years since I did this but I remember it was a very messy solution and slow. ----- Original Message ----- From: "Robert Hicks" <[EMAIL PROTECTED]> To: <dbi-users@perl.org> Sent: Tuesday, January 31, 2006 11:27 AM Subject: Column names have spaces in them!!! > I am using the ODBC module to talk to an Access database. In that > database some of the column names have spaces in them (something like > EMPLOYEE NAME). > > I have tried a bunch of stuff (backticking, brackets, braces, variables) > but I cannot seem to do a select on that table. > > my $sth = $dbh->prepare("SELECT * FROM taskhours_per_date WHERE > `EMPLOYEE NAME` = 'NAME HERE'" ); > > How do I use a column name with spaces in it?! > > I cannot change the table name itself. > > Robert >