Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data type 'first_two' does not match a defined type name.

Status
Not open for further replies.

craiogram

MIS
Feb 20, 2004
126
0
0
US
I am running the following SQL's and am getting a 3706 error with the subject description.

Code:
[b]1[/b]
create table temporaryDB.ao_test1 as (
select chapter_id from warhouse.chapter group by 1
) with data;
[b]2[/b]
create table temporaryDB.ao_test2 as(
select
	chapter_id
	,substr (chapter_id,1,2) as first_two
from 
	temporaryDB.ao_test1 group by 1,2) with data;

[b]3
select 		
	chapter_id
	, first_two
	[COLOR=red],(concat (first_two,'000000') as high_level_chapter_id [/color]
from 
	 temporaryDB.ao_test2;
[/b]
results look like:
Chapter_id first_two
07040000 07
03090201 03
08030000 08

I appreciate any help and thank you in advance.
 
You missed a closing bracket:
Code:
[color=blue],[b],([/b],[[/color]concat (first_two,'000000') [color=blue],[b],)[/b],[[/color]as high_level_chapter_id
and AFAIK there is NO concat() function in T-SQL

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
GRRRRRR,
I missed something:
Code:
[COLOR=red][b],([/b][/color]concat (first_two,'000000') [COLOR=red][b])[/b][/color] as high_level_chapter_id

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top