Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS statement on 4 different values.

Status
Not open for further replies.
Mar 17, 2005
147
US
I have a table which contains information from 4 other tables, and one of the feilds called srctable_cah or source table contains the name dbo.activities for example of where the record is from. Is there a way so that I select that feild that is shows up as simply Activities?

Remember that srctable feild can contain anywhere from 4 valued based on the table it cam from.

SELECT id_cah, title_cah, shortdesc_cah, url_cah, srctable_cah, id_cah, title_cah, shortdesc_cah, url_cah, srctable_cah
FROM admin.src_cache_cah
 
SELECT id_cah, title_cah, shortdesc_cah, url_cah, srctable_cah, id_cah, title_cah, shortdesc_cah, url_cah, Activities = srctable_cah
FROM admin.src_cache_cah
 
SELECT id_cah, title_cah, shortdesc_cah, url_cah, left(srctable_cah,4,len(srctable_cah)) as srctable_cah, id_cah, title_cah, shortdesc_cah, url_cah
FROM admin.src_cache_cah

Is that what ur looking for?

rsshetty.
It's always in the details.
 
Thanks for your help, I get the following error:
Server: Msg 174, Level 15, State 1, Line 1
The left function requires 2 arguments.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top