Solved

SQL WHERE Greater than 0

Posted on 2014-03-23
5
187 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

708 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

17 Experts available now in Live!

Get 1:1 Help Now