VB Database odbc connection and SQL question

My current sql looks like:
Dim invoiceheaderadapter As New Odbc.OdbcDataAdapter("select * from Copinvheaderfile where invhdrinvoicedate  = " & CurrentOrderDate.Text, testconnection)

I want to change it to the following where the wsdonotsend field is = N.
        'Dim invoiceheaderadapter As New Odbc.OdbcDataAdapter("select * from Copinvheaderfile where invhdrinvoicedate  = " & CurrentOrderDate.Text & " and InvHdrDoNotSendInvoice = " & wsdonotsendinv, testconnection)

This keeps telling me that the field 'n' does not exist.  I even placed it on my screen and made it a .text and placed an N in it.  I got the same results.  I tried with an 'n' directly in the sql also.  When it comes time to load the datatable is when it fails with the field N message.  What am I doing wrong?
MGaffAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gamarrojgqCommented:
Hi,

You have to add single quotes to the N since is a string otherwise the compiler will treat the N lika a column, so your sql will be

Dim invoiceheaderadapter As New Odbc.OdbcDataAdapter("select * from Copinvheaderfile where invhdrinvoicedate  = " & CurrentOrderDate.Text & " and InvHdrDoNotSendInvoice = '" & wsdonotsendinv & "'", testconnection)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MGaffAuthor Commented:
Oh nuts....forgot about the single quote thing.  Thanks,
0
gamarrojgqCommented:
ok, great, don't forget to accept the solution
0
Dirk HaestProject managerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.