Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27374

VS 2012 [RESOLVED] Get data mismatch with sql statement

$
0
0
Hi,

I have been struggling with this sql statement for my vb application and was hoping someone could offer me a bit of help please?

What I'm trying to is basically count all Bookingnumbers that = 1 AND Colours that are not red.

Code:

Dim Cmd As New OleDbCommand("Select Count(Bookingnumber) FROM LogBooking WHERE Bookingnumber = 1; ", conn)
The above does the first part correct, but when I try to introduce the latter part of the statement I get datamismatch error.

Code:

Dim Cmd As New OleDbCommand("Select Count(Bookingnumber) FROM LogBooking WHERE Bookingnumber = 1 AND Colours = NOT red; ", conn)
Any help is much appreciated.

Viewing all articles
Browse latest Browse all 27374

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>