Solved

SQL WHERE Greater than 0

Posted on 2014-03-23
5
188 Views
Last Modified: 2014-03-28
Hello,

I'm trying to create a query for vb.net connection string which will return values that are greater than 0. So far I have come up with this code of what I thought it was but I am stuck and cannot remember.

Select * From Products WHERE Pro_Qty > 0

Open in new window

0
Comment
Question by:lincstech
  • 3
5 Comments
 
LVL 19

Expert Comment

by:regmigrant
ID: 39948631
Assuming you have a table 'products' and that has a field 'pro_qty'  you have a valid sql statement - if some of those values than 0  you will get all the fields for that record.

what is your question?
0
 

Author Comment

by:lincstech
ID: 39948636
I get data type mismatch in criteria expression
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39948638
Hi lincstech;

The SQL statement you posted in your question will return all rows whose column Pro_Qty contains a value greater then 0. Is that not what it is returning?

Are you getting an exception? If so please post the exception message exactly as it is returned as well an an inner exception message.

Please post the offending code as well.
0
 

Accepted Solution

by:
lincstech earned 0 total points
ID: 39948643
I figured it in the database I had the field type set to text instead of number. Got it working.
0
 

Author Closing Comment

by:lincstech
ID: 39961071
I noticed a field in the database which was changed from text to number which resolved the issue
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calling web service and its methods dynamically 2 39
Replace &lt; with < 14 55
Put window Form inside tab page 10 26
Visual Studio 2015 Source Code Control 10 32
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 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

19 Experts available now in Live!

Get 1:1 Help Now