Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL WHERE Greater than 0

Posted on 2014-03-23
5
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 64

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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Simple Linear Regression
Progress

722 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