Solved

VB.Net - SQL Query Dependent on Potential Value in a Column

Posted on 2016-07-26
2
36 Views
Last Modified: 2016-07-26
Good Day Experts!

Can you help with a query design?

I have multiple lines of records in a table that make up a Batch of data...lets call it Batch 1234 and give it 5 records.  On each record is a field called Shipped.  It is either a 1 or a 0 value.  

I need a query that 1) Tells me if Batch 1234 is present in the table and 2) if any of the records in the batch have Shipped set to 1

Is this possible in one query without too much trouble?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41729962
that should do the job:
select max(shipped) as Shipped
from yourTableName
where batchid = 1234

Open in new window

0
 

Author Closing Comment

by:Jimbo99999
ID: 41730277
Thanks...it works great!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

20 Experts available now in Live!

Get 1:1 Help Now