🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #567

Re: case in calculated field

#567
From: Wayne Niddery [TeamB]
Date: Sun, 30 Sep 2007 21:28
20 lines
1706 bytes
Moore wrote:
> is it posible to include case in the sql of a calculated field? is yes
> then why this does not function :
>
> case TOTAl_ALB
> when (IVA_INC = 1) then 1
> when (IVA_INC = 1) and (CON_REQ = 0) then 2
> when (IVA_INC = 0) and (CON_REQ = 1) then 3
>
> TOTAl_ALB is the calculated field
> CON_REQ and IVA_INC are other fields in the same table

Show the error and the complete table definition with this calc'd field. 
Just offhand, I would expect you cannot specify the very field you are 
calculating in the SQL, you need to refer to the source value that is going 
*into* the calc'd field.
-- 
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"Bandwagons are like streetcars, there'll be another along in a few
minutes." 
Technical Details
Message-ID: <47001513$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46ffb40b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,2632d4f685f2ef38
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
From: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
Newsgroups: borland.public.interbase.sql
References: <46ffb40b$1@newsgroups.borland.com>
Subject: Re: case in calculated field
Date: Sun, 30 Sep 2007 17:28:52 -0400
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.17.170.228
Message-ID: <47001513$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1191187731 69.17.170.228 (30 Sep 2007 14:28:51 -0700)
X-Authenticated-User: wniddery
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail