Solved

SQL WHERE Greater than 0

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

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

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Make the most of your online learning experience.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

617 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