Join 2 fields to get initials HELP

  • Hi , Im trying to get a new column called initial .. I want to obtain this data from the two columns First name and surname.

    eg. Bob Ryder I want to get the first letter from both field and put in the Initials. eg- it should now say BR in initials..

    HELP

    Regards

    Ritesh

  • ritesh (11/19/2007)


    Hi , Im trying to get a new column called initial .. I want to obtain this data from the two columns First name and surname.

    eg. Bob Ryder I want to get the first letter from both field and put in the Initials. eg- it should now say BR in initials..

    HELP

    Regards

    Ritesh

    select left([First name],1)+left(surname,1) from names

    assuming that the table is called names, and the two columns in question are [First name], surname, and that these are not null

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • You could also make the (left([First name],1)+left(surname,1)) expression a computed column.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Thanks very much -you saved me once again

    Regards

  • I would try this:

    (left([First name],1)+left(surname,1))

    to computer you initial column.

    Hope this helps

    Coops

  • or...

    upper(coalesce(left([First name],1),'')) + upper(coalesce(left(surname,1),''))

    ...when you factor in Murphy's Law

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply