🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-sqlserver
Article #107

Re: referance to a Calculate field in SQL Server

#107
From: John Blessing
Date: Fri, 25 Aug 2000 00:00
33 lines
1835 bytes
You have to do:

SELECT Mark,Mark * 3 + 1 AS EXPR1, (Mark * 3 + 1) * 2  AS
EXPR2  FROM Students


--
John Blessing
http://www.LbeHelpdesk.com - home of the free helpdesk
"Yoni Almog" <ya94@hotmail.com> wrote in message
news:39a3e669@news.bezeqint.net...
> I have a table with one field: mark.
> I would like to create a quary with 2 calculated fields
that the second is
> based on the first.
>
> SELECT Mark,
>    Mark * 3 + 1 AS EXPR1, EXPR1  * 2  AS EXPR2
> FROM Students
>
> This code does not work on SQL Server.
> It says: "Invalid coloum name EXPR1"
> How can i refer to EXPR1 in this quary?
> Thanks
>
> mail me to:
> ya94@hotmail.com
>
>
>
>
>
>
Technical Details
Message-ID: <8o68m3$3ea$1@newsg3.svr.pol.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39a3e669@news.bezeqint.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110e3b,572a8a44e875726d
X-Google-Attributes: gid110e3b,public
X-Google-Thread: 104de1,572a8a44e875726d
X-Google-Attributes: gid104de1,public
X-Google-Thread: ff490,572a8a44e875726d
X-Google-Attributes: gidff490,public
X-Google-Thread: f645d,572a8a44e875726d
X-Google-Attributes: gidf645d,public
X-Google-Thread: 1143a7,572a8a44e875726d
X-Google-Attributes: gid1143a7,public
From: "John Blessing" <JB@REMOVE_THIS_LbeHelpdesk.com>
Subject: Re: referance to a Calculate field in SQL Server
Date: 2000/08/25
Message-ID: <8o68m3$3ea$1@newsg3.svr.pol.co.uk>
X-Deja-AN: 662429925
References: <39a3e669@news.bezeqint.net>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Complaints-To: abuse@theplanet.net
X-Trace: newsg3.svr.pol.co.uk 967222787 3530 62.136.109.29 (25 Aug 2000 16:59:47 GMT)
Organization: Customer of Energis Squared
X-MSMail-Priority: Normal
NNTP-Posting-Date: 25 Aug 2000 16:59:47 GMT
Newsgroups: comp.databases.ms-sqlserver,comp.lang.basic.visual,comp.lang.basic.visual.database,comp.lang.basic.visual.misc,cz.comp.microsoft.sql