2 Replies Latest reply on Jun 17, 2013 2:56 PM by p.sim

    Alias a field name in a join query

    weezerboy Level 1

      I have a database with spaces in the field names (not my fault).

       

      I am having a problem with the query because one of the fileds I am joining on has a space in its name. See bolded text.

       

      SELECT *

      FROM employee_passwords

      INNER JOIN employee_general_info

      ON employee_passwords.Employee_ID=employees.[Employee ID]

      WHERE username = '#username#' AND password = '#password#'  

       

      So I get this error message

       

      Error Executing Database Query.

       

      [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'employees.Employee ID'.

       

       

      Is there a way to alias the employees.[Employee ID] field?