Create new field

Posts   
 
    
MartinDc
User
Posts: 1
Joined: 20-Jun-2005
# Posted on: 20-Jun-2005 20:37:11   

Hello,

Using the adapter method how can I create a query that look something like this?

Select E.FirstName + ' ' + E.LastName as [FullName] FROM Employee E

So a new field with an alias named FullName

Was thinking about TypedList but can't find how to do this...

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 20-Jun-2005 21:53:10   

You can implement this with a dynamic list with 1 field. The one field has an expression, which simply 'adds' the two fields (i.e. field1 + field2) you want to concatenate. As you want a space in between, you should use a nested expression:

expression = ((field1 + " ") + field2)

As '+' in sqlserver concatenates strings, this will work OK simple_smile .

Frans Bouma | Lead developer LLBLGen Pro