Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    Unanswered: Select stmt on Column Name that is also a system function name

    Does anyone know of a workaround to a problem where a select statement fails because a column name has the same name as a system function. The column name is "Current". For example:

    1> SELECT Title from Books
    2> WHERE Current = "New";
    3> go
    Msg -131, Level 0, State 0, Server library, Line 0
    syntax error near '='

    The SQL Server is Sybase 5.5 on W2K - the related 'Current' naming problem is due to the Current Date function. For example

    SELECT Current Date;
    Aug 12 2004 12:00AM

    I am trying to resolve this without modifying the Table Column name (Current) - I am a third party doing reporting from a database not developed by me so the database would need modifing.

    Anyone have any ideas??


  2. #2
    Join Date
    Jul 2004
    Try putting brackets around it like:

    select [current] from ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts