Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 please help.

Author  Topic 

rwasim25
Starting Member

13 Posts

Posted - 2010-08-26 : 03:27:10
Please consider the below:
there is a rule in my data migration project which says..

If CCIETEC = '74' in CNV_Policy_Version then default to 'N/A'
If CCIETEC in( '70','85') in CNV_Policy_Version (i.e for Belgium policies) then use below.
select nave from simm_tbyvers
i need to capture the result in "Endorsement_Number" field.

please help

Wasim..
Senior Test Engineer

rwasim25
Starting Member

13 Posts

Posted - 2010-08-26 : 03:50:17
(select case
when CNV.CCIETEC = '74' then 'NA'
when CNV.CCIETEC in ('70','85') then (select nave from simm_tbyvers)
end) 'Endorsement_Number' from CNV_Policy_Version CNV

this is giving error...

Wasim..
Senior Test Engineer
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-08-26 : 04:20:28
Syntax error corrected.

select case
when CNV.CCIETEC = '74' then 'NA'
when CNV.CCIETEC in ('70','85') then (select nave from simm_tbyvers)
end 'Endorsement_Number' from CNV_Policy_Version CNV


(select nave from simm_tbyvers) :- Will this table have only single record ?

Regards,
Bohra

I am here to learn from Masters and help new bees in learning.
Go to Top of Page

rwasim25
Starting Member

13 Posts

Posted - 2010-08-26 : 04:29:42
(The syntax is now corrected..) Hi this is giving multiple identifier error.. may be the reason is simm_tbyvers, in the field the client want only the nave column value from simm_tbyvers.

we have more records to be displayed from the CNV_Policy_Version table but the link in the above query is only one for table simm_tbyvers

Wasim..
Senior Test Engineer
Go to Top of Page

rwasim25
Starting Member

13 Posts

Posted - 2010-08-30 : 01:40:03
Hi, I am still strucked in the code.

Wasim..
Senior Test Engineer
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2010-08-30 : 02:18:58
You should post sample data and expected output. Nothing is clear from what you have posted above.
Go to Top of Page
   

- Advertisement -