Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-06-14 : 09:39:54
|
Hi,i am trying to load output of count(X) and sum(salesamt) into the same column. if iam using transformation data task what datatype should i be converting the two outputs to accomidate result as10.00 --count234.00 --saleamt22.00 --count1000.00 --saleamt |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-14 : 10:10:58
|
Select count(col) from table group by somecolunion allSelect sum(col) from table group by somecolMadhivananFailing to plan is Planning to fail |
 |
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-06-14 : 11:00:33
|
thanks MADHIVANAN for the quick responce but iam doing this in a package my pkg runs in a loop to grab one column at a timethe first 2 times it is using a count() function and 3rd time its sum().result is stored in a fact table with ids like thisSRVR_ID CNTRY_ID METRIC_VALUE1 101 10 (FIRSTCOUNT RESULT)1 101 30 (SECOND COUNT RESULT)1 101 2500.00 (SUM OF DOLLER AMOUNT)2 102 50 2 102 202 102 3000.00SOURCE SYSTEM HAS DOLLERAMOUNT IN DATATYPE-MONEY WHICH I WANT TO STORE ALONG WITH THE INT RESULTSWHAT DATATYPE SHOULD I CHOOSE FOR ALL THE THREE COLUMNS IF IAM USING A TRANSFORMATION DATA TASK IN THE PKGORSHOULD I CHANGE THE DATATYPE IN THE SELECT STATEMENT AT EXTRACT TIME. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-15 : 06:28:12
|
I think you can make use of float or decimal datatypeMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|