problem with SQL sintax

Posted on 2011-10-27
Last Modified: 2012-05-12

I have the following SQL:

SELECT bbbpintura.pint, bbbpintura.serial, bbbpintura.parte, bbbpintura.lijador, bbbpintura.fecha
FROM CEDRO.dbo.bbbpintura bbbpintura
WHERE (bbbpintura.serial Like '%'?'%')

I'm triying to obtain in excel the list of rows from bbbpintura table wich serial field starts by the value in cell B1.

When I'm doing the parameter in the microsoft query I have the error: incorrect sintax near '@P1' and the query does not works.

could you help me to fix this please.?

Thank you for your time,
Question by:Pabilio
    LVL 25

    Accepted Solution

    I suspect your where clause is wrong.

    Try this:

    WHERE (bbbpintura.serial Like '%' + ? + '%')
    LVL 1

    Expert Comment

    WHERE ((bbbpintura.serial Like  '%\''?\''%')
    LVL 5

    Author Closing Comment

    thank you very much...
    this solved the problem
    LVL 25

    Expert Comment

    by:Lee Savidge
    No problem :)

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now