bombdropVB
Programmer
Now i need to perform a sub query .
this return no row but it should return 1
I i run the sub-query on its own it returns the value i am looking for namely '96/02/00276'.
if I place 96/02/00276 in the where statement instead of the sub query i get the desidered result but i need this wo work as a sub query as i wish to coonvert to a an SP any one help please??
Code:
declare @AccountCode int
set @AccountCode=5
SELECT
c.clientshort,
c.clientname,
c.contact1,
c.telephone1,
c.fax1,
c.email1a,
a.address1+a.address2+a.address3 +a.address5+a.address6 + a.postcode AS Address
FROM
ace.dbo.Client c
INNER JOIN ACE.dbo.Address a ON
c.addressref = a.addressref
INNER JOIN ACE.dbo.claim ON
ACE.dbo.claim.clientref=c.clientref
INNER JOIN ACE.dbo.policy p ON
ACE.dbo.claim.policyref = p.policyref
WHERE
p.certificate= ( SELECT
shortname
FROM
gamaccount
WHERE
accountref=@AccountCode
)
this return no row but it should return 1
I i run the sub-query on its own it returns the value i am looking for namely '96/02/00276'.
if I place 96/02/00276 in the where statement instead of the sub query i get the desidered result but i need this wo work as a sub query as i wish to coonvert to a an SP any one help please??