| 
                
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. 
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | MarkInKeizerStarting Member
 
 
                                        2 Posts | 
                                            
                                            |  Posted - 2013-08-14 : 13:21:22 
 |  
                                            | I'm a VB6/Access VBA developer and nesting together string functions to get a result is pretty standard stuff. I'm thinking it's not supported in SQL Server based on this. Is that true or do I have a bonehead error in here I'm simply not seeing? ThanksSELECT FD.FieldID_FK	  ,F.TableName	  ,F.FieldName      ,FD.FieldDescription      ,SUBSTRING(FD.FieldDescription,charindex('CODE DESC',FD.FieldDescription),LEN(FD.FIELDDESCRIPTION) as fldGroupID   FROM [reference].[meta].[tblFIELDS_DESCRIPTION] FD, reference.meta.tblFIELDS F  WHERE fielddescription like '%CODE_DESC%' and		F.fieldid = FD.fieldid_fk-----Msg 156, Level 15, State 1, Line 5Incorrect syntax near the keyword 'as'.VERSION INFO BELOWSQL Server version 2005 -- 9.00.3042.00	SP2	Standard Edition (we'll be on 2008R2 in about two weeks).Microsoft SQL Server Management Studio						10.0.2531.0Microsoft Analysis Services Client Tools						10.0.1600.22Microsoft Data Access Components (MDAC)						3.85.1132Microsoft MSXML						2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer						8.0.6001.18702Microsoft .NET Framework						2.0.50727.3615Operating System						5.1.2600Captain Kirk will be blasting Klingons before my employer retires WinXP Pro.  Mark~Mark |  |  
                                    | MuMu88Aged Yak Warrior
 
 
                                    549 Posts | 
                                        
                                          |  Posted - 2013-08-14 : 13:40:26 
 |  
                                          | You are missing a parenthesis before 'as' quote:Originally posted by MarkInKeizer
 I'm a VB6/Access VBA developer and nesting together string functions to get a result is pretty standard stuff. I'm thinking it's not supported in SQL Server based on this. Is that true or do I have a bonehead error in here I'm simply not seeing? ThanksSELECT FD.FieldID_FK	  ,F.TableName	  ,F.FieldName      ,FD.FieldDescription      ,SUBSTRING(FD.FieldDescription,charindex('CODE DESC',FD.FieldDescription),LEN(FD.FIELDDESCRIPTION)) as fldGroupID   FROM [reference].[meta].[tblFIELDS_DESCRIPTION] FD, reference.meta.tblFIELDS F  WHERE fielddescription like '%CODE_DESC%' and		F.fieldid = FD.fieldid_fk-----Msg 156, Level 15, State 1, Line 5Incorrect syntax near the keyword 'as'.VERSION INFO BELOWSQL Server version 2005 -- 9.00.3042.00	SP2	Standard Edition (we'll be on 2008R2 in about two weeks).Microsoft SQL Server Management Studio						10.0.2531.0Microsoft Analysis Services Client Tools						10.0.1600.22Microsoft Data Access Components (MDAC)						3.85.1132Microsoft MSXML						2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer						8.0.6001.18702Microsoft .NET Framework						2.0.50727.3615Operating System						5.1.2600Captain Kirk will be blasting Klingons before my employer retires WinXP Pro.
  Mark~Mark 
 |  
                                          |  |  |  
                                    | MarkInKeizerStarting Member
 
 
                                    2 Posts | 
                                        
                                          |  Posted - 2013-08-14 : 14:24:55 
 |  
                                          | That was it, thanks MuMu88~Mark |  
                                          |  |  |  
                                |  |  |  |  |  |