Calculated field in a calculation.

From: Lind (anonymous_at_discussions.microsoft.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 09:40:24 -0700

In Access if
FieldA = FieldB + FieldC
And
FieldC = FieldD - FieldE,
I can use the statement
FieldA = FieldB + FieldC
but in SQL Server, I need to use
FieldA = Field B + (FildD-FieldE)

This works fine with a simple query. However, the queries
I would like to move to SQL Server Stored Procs have SQL
statements that run between 3 and 4 pages with many
calculated fields consisting of several other calculated
fields. How are such things (large queries with very
convoluted calculations) normally handled in SQL Server?



Relevant Pages

  • Re: Conditional create table
    ... If fielda is non-blank, ... if fieldb is non-blank, ... if fieldc is non-blank, ... You can put text, complete tables, and field codes inside the IF "results" as I have indicated. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: constraint in Trigger
    ... CREATE TRIGGER tiu_name ON tblName ... IF (@FieldB IS NOT NULL) AND (@FieldA IS NULL) ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Percentage at group level of Crystal Report.
    ... FieldC is a formula field, dividing FieldA by FieldB. ... > as to how to create a group level value for FieldC, ...
    (microsoft.public.vb.crystal)
  • Re: Query:When 1 field in a table is not = to another field (same tab
    ... WHERE NOT(fieldA IN(fieldB, fieldC) OR fieldB IN) ... saved as, say, qu1, then ...
    (microsoft.public.access.queries)
  • Pivot Grand total on Selected columns only
    ... each day has 4 data fileds (fieldA, FieldB, fieldC, FieldD)+ extra ... i need to find a way of showing Grand total which sum up ONLY ...
    (microsoft.public.excel.programming)

Quantcast