troubleshooting Question

I have a query that I want to return a field and then a value.

Avatar of TimSweet220
TimSweet220 asked on
1 Comment1 Solution225 ViewsLast Modified:
I have a query that I want to return a field and then a value.
Here is the basic query:
select abr_id
from tblStateLicense
where ABR_ID IN
                          (SELECT DISTINCT abr_id
                            FROM          tblMoc
                            WHERE     MOCStatus <> 'Inactive' and MOCStatus <> 'Complete'
                      AND expireyear = '2007')
Order by ABR_ID

What I want to do next is to check a field in the db (tblStatelicense.expirationdate) . It is a date field and I need to check it again today date (getDAte()) and return a value of Y if they have not expired and N if they have expired.  There maybe multiple returns for one ID and some of those rows retunred will be expired and some won.  But if they have at least on non-expired date then they should get a yes.

so my recordset would be    ID  Expired
                                            1234   N
Thanks in advance.  Using SQL 2000

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros