Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

Query Question how to get desired result.

$
0
0
Ok so I have a query that returns a bunch of fields and rows from a large table and I find that I need to calculate a value from another table and hopefully have that value display in the resulting recordset as a field.

To keep it simple let's say I have a query

Select recorid,description,dtstamp and several more fields from table1

From the second table I need to know if there are any rows with the matching recordid and a status='PS'
I could work with either a count of the records or just a true false based on if there is a match or not.

I am thinking maybe a sub query of some sort using count() but can't determine how to write it.

Keep in mind this table2 may have no records in it with a matching recordid or it may have lots of them and those that may be there may or may not have the status='PS' and I basically just need to know if there are any with matching recordid and status='PS'

Any hints?

Viewing all articles
Browse latest Browse all 2918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>