473,394 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

reference column name

144 100+
hi,

how to reference an alias column name that consists more than one word.

it's like this

select address, substring(address, 5, 8) as 'member's address' from msmember
where charindex('r', substring( alias column name, 1, 6))>0

i want to check if the first 6 chars of 'member's address' contains 'r'.


thx.
Apr 5 '08 #1
1 2004
ck9663
2,878 Expert 2GB
hi,

how to reference an alias column name that consists more than one word.

it's like this

select address, substring(address, 5, 8) as 'member's address' from msmember
where charindex('r', substring( alias column name, 1, 6))>0

i want to check if the first 6 chars of 'member's address' contains 'r'.


thx.

I don't think you're allowed to have quote in a column alias.

Try this instead:

Expand|Select|Wrap|Line Numbers
  1. select address, substring(address,5,8) as [member address] from msmember where charindex('r', left(address,6)) > 0
  2.  
Watch out for space on the left side of the address field.

-- CK
Apr 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: malcolm | last post by:
Example, suppose you have these 2 tables (NOTE: My example is totally different, but I'm simply trying to setup the a simpler version, so excuse the bad design; not the point here) CarsSold {...
7
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
2
by: Ric#k | last post by:
Is it possible to reference all the public properties that are in a class within that class's constructor using REFLECTION, and then reference them with a string variable? I have a class that will...
0
by: MrMike | last post by:
Hi. I have an asp:ImageButton which appears when a datagrid row is placed in Edit mode. The button has it's own click event which fires when the button is clicked. Within the button's click...
0
by: dba123 | last post by:
THERE HAS TO BE A SOLUTION FOR THIS!!!! How can I get around the limitation in SSRS 2005 of being able to SUM a Group referenced field in my FOOTER!!! It's driving me nuts My footer field's...
1
by: aj | last post by:
DB2 LUW latest & greatest 8.2 FP11 Is there any way to dynamically reference the table and/or column name in a trigger body, perhaps w/ a special register or something? SP WRITE_AT() is...
10
by: Arpan | last post by:
Consider the following code that adds a table to a DataSet dynamically: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'Create an empty DataSet Dim dSet As...
35
by: Chris | last post by:
Hi, I tried to create a class which must change the propety 'visible' of a <linktag in the masterpage into 'false' when the user is logged. But i get the error: "Object reference not set to an...
3
dbushcmohle
by: dbushcmohle | last post by:
Hello, I currently have some list boxes that are referenced by the column number... (see below) If lstLots.Column(7) = 0 Then How do I reference the Column name instead....?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.