Re: Calculating Query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi:

Thanks for responding but I really don't understand your answer. If
possible please clarify it for me.

"MGFoster" wrote:

> bolow wrote:
> > Hi All:
> >
> > I have created a query that pulls information from two tables and
> > calculates. The query pulls one column from table A and one from table B.
> > The calculation is in this form A-B = C (column c is the result of the
> > subtraction taking place between the values in columns A and B). I am also
> > using a left join since Table B will have more information than table A. My
> > problem is that in order for the calculations to be correct I need to build
> > an expression that will insert a zero when no data is present. Since Table B
> > will have more rows the corresponding column from table A will be blank. I
> > need the blank spots from table A to appear as zeros in the query. I have
> > included the SQL version for clarification. Any help would be greatly
> > appreciated.
> >
> > SELECT [Table B].[Job No], [Table B].[Cost], [Table A].[Actual Costs],
> > [Table B].[Cost]-[Table A].[Actual Costs] AS Calculated_Costs, [Table
> > B].[Earned Revenue], [Table A].[Revenue Earned], [Table B].[Earned
> > Revenue]-[Table A].[Revenue Earned] AS Calculated_Revenue
> > FROM [Table B] LEFT JOIN [Table A] ON [Table B].[Job No] = [Table A].[Job No];
> >
> >
>
> Use Nz(column,0). E.g.:
>
> Nz([Table A].[Revenue Earned],0) As RevenueEarned
>
> --
> MGFoster:::mgf00 <at> earthlink <decimal-point> net
> Oakland, CA (USA)
>
.



Relevant Pages

  • Re: Calculating Query
    ... If possible please clarify it for me. ... I have created a query that pulls information from two tables and calculates. ... Oakland, CA ...
    (microsoft.public.access.queries)
  • Calculating Query
    ... I have created a query that pulls information from two tables and ... The query pulls one column from table A and one from table B. ... The calculation is in this form A-B = C (column c is the result of the ... an expression that will insert a zero when no data is present. ...
    (microsoft.public.access.queries)
  • Re: Calculating Query
    ... I have created a query that pulls information from two tables and calculates. ... The query pulls one column from table A and one from table B. The calculation is in this form A-B = C. ... I am also using a left join since Table B will have more information than table A. My problem is that in order for the calculations to be correct I need to build an expression that will insert a zero when no data is present. ...
    (microsoft.public.access.queries)
  • Re: Multiple Many-to-Many relationships
    ... I suppose I should clarify the purpose of this query. ... relating to specific sets of information. ... should return a set of information about the articles (Author, Date, ... So, to clarify from what I already have, I will state what I ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Database Replication
    ... I agree with Adam, but just to clarify, if you mean queries applied to the ... publisher then there' s no issue, but if the query is to the subscriber, you ...
    (microsoft.public.sqlserver.replication)