Syntax help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farriswheel
    New Member
    • Sep 2006
    • 8

    #1

    Syntax help

    Good Day,

    I have a table that is labeled temp order_tbl.
    I understand that sql reads the space so the correct way to get around the space is to use brackets: SELECT [temp order_tbl] which seems to work fine until I try the INSERT INTO function:

    INSERT INTO temp order_tbl this gives me a syntax error

    INSERT INTO [temp order_tbl] this gives me invalid use of brackets

    any ideas?

    Thanx
    Farris
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    The correct syntax is (using date1 and CustName as sample fields):

    INSERT INTO [temp order_tbl] ( date1, CustName ) SELECT #11/05/2006# AS Expr1, "John Doe" AS Expr2;

    OR

    INSERT INTO [temp order_tbl] ( date1, CustName ) VALUES (#11/05/2006#, "John Doe");

    Comment

    • farriswheel
      New Member
      • Sep 2006
      • 8

      #3
      Originally posted by mmccarthy
      The correct syntax is (using date1 and CustName as sample fields):

      INSERT INTO [temp order_tbl] ( date1, CustName ) SELECT #11/05/2006# AS Expr1, "John Doe" AS Expr2;

      OR

      INSERT INTO [temp order_tbl] ( date1, CustName ) VALUES (#11/05/2006#, "John Doe");


      Thanx!!!!!
      I understand now
      Farris

      Comment

      Working...