There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem problems router slow sound startup trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
SQL Query Help Please!


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
JWasibpi's Avatar
Member with 34 posts.
 
Join Date: Mar 2002
06-Sep-2002, 03:55 PM #1
Smile SQL Query Help Please!
Sql server on a Windows 2000 platform.

I have two tables that contain data. Table one has a column that is contained (foreign key) in table two. It also has a column NOT contained in table 2 that I need to multiply by the variable amount identified in table 2. The variable amounts are 12, 4, and 2. The variable held in table two is the multiplying factor.

IE:
all the 10's (from table 1) with a "Q" (from the foreign key) need to be multiplied by 4 from table 2 and then the results added up for a total.

Basically, all "10's" in table one that are connected to table 2 with a "Q" must be multipled by 4 and then summed.

The data figures from table 1 will vary but all of them that are identified by "Q" linked to table 2 as identified by "Q4" in the foreign key, must be multiplied by 4 and then added together.

What I want....

A stored procedure that will recognise an imput that will be a mix of A's, S's, Q's, and M's. It will multiply all the "Q's" by 4, sum the "Q's", multiply all the "S's" by 2, sum the "S's", multiply all the "M's" by 12, sum the "M's", Multiply all the "A's" by 1, sum the "A's" and then sum the sums of A's, S's, Q's, and M's.

Seems simple to some of you I know but mind boggling to me. A little help if you please!!

Thanks in advance.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:09 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.