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 Programming
 Concat Error

Author  Topic 

jpockets
Starting Member

45 Posts

Posted - 2007-07-02 : 12:19:48
I'm trying to get month/year from column X_POLICY_EFCTV_DT, i tried this

Concat(month(rr.X_POLICY_EFCTV_DT),
year(rr.X_POLICY_EFCTV_DT))


But i'm getting an error concat is not a recognized function name

is there a better way to get month/year from that column?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-02 : 12:22:39
select stuff(convert(char(5), rr.X_POLICY_EFCTV_DT, 103), 3, 1, '')


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-07-02 : 12:24:46
Don't think there is such a function as Concat in T-SQL. Maybe you want
cast(month(rr.X_POLICY_EFCTV_DT) as varchar(2))+ cast(year(rr.X_POLICY_EFCTV_DT) as varchar(4))


yuk

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -