MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 5th, 2005, 11:33 AM
umasql umasql is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 8 umasql User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 57 m 48 sec
Reputation Power: 0
sample query for concatenating two strings and using it as column

hi,
please check this query and reply back with the appropriate solution.
len(ltrim(rtrim(exec('select' ' ' + 'pay' +convert(substring(@y1,3,2), varchar 2)))))<>0
here the concept is concatenating two string then that result is used as column and retreiveing data.but this is considering it as string instead of column.
can anyone give an appropriate solution.

Regards,
Uma.

Reply With Quote
  #2  
Old January 5th, 2005, 11:48 AM
paulh1983 paulh1983 is online now
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2004
Posts: 1,241 paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 13 h 3 m 39 sec
Reputation Power: 17
i m not sure, just guessing here, say the colum name is firstName

select firstName as concat(select+pay) from......

i dunno,

Reply With Quote
  #3  
Old January 5th, 2005, 01:00 PM
umasql umasql is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 8 umasql User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 57 m 48 sec
Reputation Power: 0
sample query for concatenating two strings and using it as column

thanks for the reply but let me be clear with my query. the query is as follows:
actually i need to get the records of a particular table from year 1982 to 2003 that is assigned to be pay. so instead of querying for each year i want that to be done in a single query using while hence i quered as i mentioned before.

Regards,
Uma.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > sample query for concatenating two strings and using it as column


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway