views:

52

answers:

1

I am trying to create a calculated field in one of my database tables, but I keep getting the error

Error Validating the formula for column FullName

I am not trying to incorporate other calculated fields so this should work.

I'm using SSMS 2008 R2 with a SS2005 back end.

So in the formula field I've tried:

Trim([dbo].[Contact].[FirstName] + ' ' + [dbo].[Contact].[LastName])

and

Trim([FirstName] + ' ' + [LastName])

Not sure what the problem is. Any help would be much appreciated.

Thanks!

~DJ

+3  A: 

Try this:

rtrim(ltrim([FirstName] + ' ' + [LastName]))
Denis Valeev
Yes, that's what I meant, got Visual Studio 2010 on the brain, clearly given that I forgot Trim _wasn't_ a keyword. 2008 R2 took the formula, which is fantastic, thank you! I can see FullName as a field now, but when I select * from Contact, this field doesn't show. Is there more to computed fields that I'm unaware of?
DJ Quimby
Nevermind. We have three database versions here. That one query window was pointing to a different database. All is well, thanks again Denis
DJ Quimby