C/ODBC - SQL syntax

PeterReidPeterReid Member Posts: 3
edited 2004-08-20 in Navision Financials
Some of our fieldnames contain spaces and I was wondering what should be used to encapsulate these fields when building SQL for ASP pages (on IIS5)

The following SQL will work in Access but not in ASP'

SELECT * FROM Item WHERE [PartNo Alt] = 'XYZ1';

What do I need to change to make this work with ASP?

TIA

Pete

Comments

  • PrebenRasmussenPrebenRasmussen Member Posts: 137
    Use double quotes around the fieldnames:
    SELECT * FROM Item WHERE "PartNo Alt" = 'XYZ1';
    

    or
    SELECT * FROM Item WHERE ""PartNo Alt"" = 'XYZ1';
    

    depending on your situation.
  • PeterReidPeterReid Member Posts: 3
    Thanks!

    The double quotes worked for me
Sign In or Register to comment.