Results 1 to 3 of 3

Thread: [RESOLVED] What's wrong with this SQL "Update" statement?

  1. #1

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Resolved [RESOLVED] What's wrong with this SQL "Update" statement?

    UPDATE PROD.Customer
    SET Prod.Customer.Rooms_Used = '4'
    WHERE ID LIKE '%00'
    AND CANCELLED <> 'Y'
    AND DATE <= To_Date ('2005/06/30','YYYY/MM/DD')

    It used "Debug.Print" to give me the results of a query I have in VB.
    This is what VB is sending Oracle, but it keeps coming back saying "Missing Expression". Any ideas as to why?
    Last edited by The_Grudge; Jun 1st, 2005 at 07:23 AM.

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: What's wrong with this SQL "Update" statement?

    Quote Originally Posted by The_Grudge
    UPDATE PROD.Customer
    SET Prod.Customer.Rooms_Used = '4'
    WHERE ID LIKE '%00'
    AND CANCELLED <> 'Y'
    AND DATE <= To_Date ('2005/06/30','YYYY/MM/DD')

    It used "Debug.Print" to give me the results of a query I have in VB.
    This is what VB is sending Oracle, but it keeps coming back saying "Missing Expression". Any ideas as to why?
    Not sure about ORACLE, but in MS SQL those ID and DATE column names are reserved keywords and need to be in []-brackets (such as [DATE] <=...) in order to work.

    May be that the OLEDB provider requires that also...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: What's wrong with this SQL "Update" statement?

    It's amazing how just entering the actual names of the fields can fix everything!

    I have no field named "DATE". It's called "END_DATE".

    Yikes.

Posting Permissions

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



Click Here to Expand Forum to Full Width