Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2006, 08:40 PM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to multiply two value from two fields

I have the following fields in table A:

 GL_ID|GL_Name_VC | Amount |Period_TI|Year_SI
================================================== =
  1000| Inventory| 8,000.00 | 01 | 2005
================================================== =
  1000| Inventory| -3,000.00 | 02 | 2005
================================================== =
  1000| Inventory| 5,000.00 | 02 | 2005
================================================== =

the fields above have the following datatype:

 Fields | Datatype
 ===================================
 GL_ID | Integer
 GL_Name_VC | Variable Character
 Amount | Integer
 Period_TI | TinyInteger
 Year_SI | SmallInteger

The above database is running on Microsoft SQL Server 2000 and i would like to query
for a report that looks something as below:

GL_ID|GL_Name_VC |Period_01|Period_02 |Total_YTD
================================================
1000 | Inventory | 8,000 | 2,000 |10,000

       Percentage| 10% | 20% | 0
================================================
       Total | 800 | 400 | 1,200

 The Total row is calculated by multiplying the percentage row by the Inventory amount in
each Period.

Guys, hope someone out there can help me with the sql command for the above report?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Design question - Change multiply reports roy_mm Reporting Services 1 January 16th, 2007 05:01 PM
send multiply query one stored procedures vipinpaliwal1980 SQL Server 2000 3 April 20th, 2006 12:34 PM
multiply two ASP values together crmpicco Classic ASP Databases 5 January 27th, 2005 08:53 AM
Using Forum fields select fields on the fly hellosureshkumar Crystal Reports 0 December 17th, 2004 08:20 AM
Using fields morpheus Classic ASP Databases 9 November 20th, 2003 12:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.