i am trying to use the following statement to pull a specific bin from the database but I also want to add the specific warehouse to the case.
SELECT CASE WHEN EXISTS(SELECT binlabel
FROM binmstr with (nolock)
WHERE empty=’Y’) THEN (SELECT top 1 binlabel
FROM binmstr with (nolock)
WHERE empty=’Y’ and binlabel not like ‘#%’
order by binlabel) ELSE ‘NOMORE’ END as binlabel
New contributor