Smart Aggregation
Jan 1, 2007
I'm having problems implementing the following in reporting services 2005.
My hierarchy looks like this (just to illustrate the problem...):
University->Student->Exam
My query returns the following fields:
University,Student,StudentPayment,ExamName,ExamScore
I need to create a report that will show the hierarchy and to smartly aggregate the StudentPayment to both the Student and the University levels.
The problem is that the StudentPayment field is being multiplied by the number of exams in the upper level aggregation.
If only I could set the granularity level of the StudentPayment measurement...
Note that I don't have access to the query, so I can't change anything on that front.
Thanks,
Efi
View 6 Replies
ADVERTISEMENT
Mar 9, 2004
Hello All,
I've been trying to get a range of values out of my SQL Server 2000 db without sucess. The field in question has the data type of char(8) and looks like this:
House_numbr_pub (leading spaces in front of each value)
140A
140
141
142
143
144
145
146
147
148
149
150
151
.
.
.
14500
.
.
.
Does anyone know how write a sql statement that will return 140-150, but excluding the ' 14500' and 100-1000. I tried the following where clause to return a range between 100-1000.
WHERE (cook.STREET_PUB LIKE 'lincoln%') AND (LEN(LTRIM(cook.HOUSE_NUMBR_PUB)) BETWEEN 3 AND 4) AND (
(LTRIM(cook.HOUSE_NUMBR_PUB) >= '100') and (LTRIM(cook.HOUSE_NUMBR_PUB) <= '1000') )
This where clause only return two records (100 and 1000). I want it to return 100-1000.
I also tried the following where clause:
WHERE LTrim(cook.HOUSE_NUMBR_PUB) like '1[45][0-9]'
OR
LTrim(cook.HOUSE_NUMBR_PUB) like '1[45][0-9]'
However, building this on the fly with .net will take some effort if someone is trying to search range 1-10000000.
Please Help,
James
View 3 Replies
View Related
Oct 25, 1999
Is it possible to do the following without cursors or creating an identity column:
I have a table from legacy data with ~ 1 million records. I need to insert this into the new table which has a unique varchar(11) key. For the new system this key is generated by calling a SP that returns the next key in sequence. To put the legacy data records in the same table I want to first create a new column at end of legacy data table and populate this using SQL without going thru using cursor and calling the SP for each and every record to get a unique varchar(11) key.
In short here is what I want:
Field1 Field2 varchar(11)key
------ ------ -----------
jsdhf dsf99 1LEG
878jh whjhj 2LEG
8728jh whjhj 3LEG
8578jh whjhj 4LEG
3878jh whjhj 5LEG
6878jh whjhj 6LEG
8508jh whjhj 7LEG
...
...
...
4878jh whjhj 1000000LEG
How do I generate this key using an SQL stmt?
Thanks in advance,
Nishi
View 4 Replies
View Related
Oct 10, 2007
Hello forum.
I have a problem that is kill me.
Initial dates: a table (Tbl_1) to collect dates from users (within form in VB), a view (View_1) to compute some columns (is a part from business€™ logic) and a table (Tbl_2) designated for a trigger.
I will try to resume the contents of above table€¦
create table Tbl_1
(
id int not null,
code varchar(10) null,
TBO int not null, -- (Time between Overhauling)..hours (life cycle)
T_Hrs_AtLastOvh int null, -- total running hours from last overhauling
TRH int null, -- total running hours (the life of equipment)
)
GO
Create view View_1
as
select code, [TBO]-([TRH]-[T_Hrs_AtLastOvh])as HrsTo_NextOvh
from Tbl_1
GO
create table Tbl_2
(
id int not null,
code varchar(10) null,
Start_dt smalldatetime,
Stop_dt smalldatetime,
)
GO
--drop table Tbl_1
--drop view View_1
--drop table Tbl_2
Let to insert some dates into Tbl_1:
Insert into Tbl_1
select 1,'cod1',2000,2500,3000
union all
select 2,'cod2',3000,4000,7000
union all
select 3,'cod3',1000,2000,2000
union all
select 4,'cod4',1500,3000,3000
GO
The result of View_1 is in Fig.1:
Fig.1
cod1
1500
cod2
0
cod3
0
cod4
2500
cod1
1500
cod2
3000
cod3
0
cod4
2500
Fig.2
The operator perform requested job for the equipment and the life cycle starts counting again. Suppose to have:
Update Tbl_1 set T_Hrs_AtLastOvh=7000 where id=2
GO
The result of View_1 is Fig.2.
I wish to insert (within trigger) into table Tbl_2 all codes that have [HrsTo_NextOvh]=0 from View_1 and automatic to record the date when the record is done with a propertie like €™starting job€™.
After the operator executed the job, he will update the Tbl_1 (the result is in Fig.2) and the trigger has to record this process with the propertie like €˜completed job€™.
Depending by the time between overhauling and the operating hours of equipments, this task happens more or less often.
My intentions are to record the time requested to executed a job and to make a history of events.
Any suggestion to solve my problem is full apreciated.
View 6 Replies
View Related
May 8, 2002
Hi,
tell me please how I can trace the modification on the table such as "insert" record into one and syncronize mirror table at the same time once the insert has happend, BUT - no indexes no trace jobs, no any modification or objects on the master table... ha?
View 5 Replies
View Related
Jul 20, 2005
I'm still a database newbie so I would like to solicit thoughts aboutthe smartest way to do something in sqlserver.My company has a web application that we customize for each client.We can do this because everything is database driven. We havedatabase tables that contain our HTML and database tables as well assome standard tables for each database. We have an in house app thatlets us tweak both of these things and creates a new web site anddatabase tailored to each project.Each of these sites has a table that stores a schedule are clientsuse.The records in this schedule table change when information in othercustom generated tables change.My company currently uses a legacy foxpro app to update the scheduletable.The foxpro app contacts sqlserver, reads a table with a list of tablesand scheduling information to check, checks each of those items andupdates the schedule table.I would like to lose the foxpro app.At first thought.........as a database newbie.......putting triggersin each of the tables to update the schedule when something changesseems the way to go.However, since we change a part of the schema ( we have an app thatgenerates the database tables unique to each client ) for each clientI would like a scheme that would not involve having to create adifferent trigger for each new table.I would also like something that updates in real time. Right now thefoxpro app is executed once a day.I was thinking of making a large stored procedure and putting anidentical call to that procedure in each table.Each table would have the same trigger in it that would get fired whenthe record was altered. It would call the stored procedure withrelevent arguments to update the schedule.Does this sound like a smart way to solve this problem or am I notthinking "database enough"?Any thoughts are welcome.I would like to build a better solutionSteve
View 1 Replies
View Related
Apr 18, 2006
I'm a bit stuck with this one... hope someone can help.
I'm trying to develop an application that will run on a pocket PC with Windows CE 4.2
I'm using .Net 2003 and the application is in VB.Net.
I can run the application on the pocket pc fine (ie. form paints, buttons work) , until I need to connect to Sql DB on the server.
When I try to create a connection object (Dim dbconnection As New SqlClient.SqlConnection)
I get an error stating .. "This application (test.exe) requires a newer version of .Net Compact Framework than the one installed on the device" .... "could not load System.Data.SqlClient.SqlConnection from assembly System.Data.SqlClient Version=1.0.5000.0"
The version that it is looking for is. 1.0.5000.0 . The VS2003 is using this version.
I've downloaded the compact framework v1. sp3 , ran all the cabs on the Win CE device ... it looked that it installed fine.... but the problem still exists.
Help Please..
Derek
View 12 Replies
View Related
Jul 6, 2015
what is the concept of smart backup in sql ?
View 1 Replies
View Related
Oct 16, 2006
Hey all... great site!
Here's what I'm going for:
I have an 05 VB.NET windows application that will be used as a smart client for our folks in the field. The windows application includes 05 SQL Server Express. I have included in the Data Sources of my project and attached file going through the wizard Microsoft SQL Server Database File (SqlClient) ='s (myfile.mdf) and then selected all tables, views, stored procedures, and functions... the corresponding myfileDataSet.xsd with the myfile.mdf are now located in the root of the project. I now recompile the project without error and go to the properties section Publish tab... select the Application Files button and myfile.mdf Publish Status is set to Include and the Download Group set to Requried. With this in place I right click on the myfile.mdf from the Soultion Explorer and under the properties section have set the build action to compile and use the copy always setting for the Copy to Output Directory.
My app.config looks like this:
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="myfile.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="myfile.My.MySettings.ffgscrmConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|myfile.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
After the publish is completed on the client machine... install for Windows Installer 3.1, SQL Server Express, and the Windows Application contains no data but everything else works fine.
My problem is that I need to attach the myfile.mdf to the new SQL Server Express instance on the client machine during the installation process so that when the application fires it will be pointed to the above location on the client.
Any ideas... scripts... includes for an ApplicationEvents.vb on how to do this? Thanks a ton... :)
Kind regards,
BillB
Your mind is like a parachute.. It has to be able to open, for it to work.
View 1 Replies
View Related
Feb 8, 2007
declare @ContactId as integerset @ContactId = 5select *from Person.Contactwhere ContactId = @ContactIdOR @ContactId = -1If you run this in SQL 2005 on the AdventureWorks database,why the logical reads is 561Table 'Contact'. Scan count 1, logical reads 56and not 2 when you run without the second OR condition:declare @ContactId as integerset @ContactId = 5select *from Person.Contactwhere ContactId = @ContactIdHow can i use the same SP and either get one record returnedby passing the ID of the field, or pass a dummy parameter like-1 in order to get ALL the records returned.In this case even when i pass a parameter like ContactID = 5there is still a table scan (clustered index scan in this case)happening for the other OR condition.There's no method to tell SQL to start checking the first conditionwhether or not it is true then if it is false then check the second ORconditon. On the same topic does this mean all OR conditions areALWAYS verified regardless if one of them has already been determinedto be True?Thank you
View 2 Replies
View Related
Jul 12, 2007
Hello geniuses
First of all I would like to announce that this is my first time I post here.. However, I'm pretty sure that I'm in the best place to ask what I want. To cut the story short, I'm querying SQL database on a remote machine and having the result saved (mapped) to another table on another database on the same remote machine. The thing is the destination table was empty before the query was run the first time. I have been searching for some smart way so that when I modify the source tables that my query is based on, it doesn't affect except the modified rows. In other words, it should be like if the row is already there, do nothing. otherwise, it updates the existig record. else, it's a new record and it's inserted. I think what i need will include some coding for sure, yes? I don't know if i'm clear about the requirement or not though! but I know that you are experts and can direct me. Waiting for your valuable replies.
Sherif Magdi
View 11 Replies
View Related
May 21, 2008
I've created a simple application that uses a SQLCE 3.5 database. When I debug it SQLCE 3.5 is deployed to the emulator. However, I made a "smart device cab project" for my application and copied the cab file to my windows mobile 6 device and it does not deploy SQLCE 3.5. I don't see a way to specify the prerequisites of the "smart device cab project" like you can in a normal setup project. How can I get SQLCE 3.5 to deploy with my application...or even just get it on my device? I've tried installing it on my desktop with the device connected via active sync, but it doesn't install on the device like the compact framework did.
View 3 Replies
View Related
Nov 20, 2005
So in a previous thread I discovered that in order to actually subscribe to any publication, the publisher needs to be a well-known network name, requiring DNS resolution. You can't simply point a SQLExpress instance at an ip addressinstance and have it resolve the communications.
View 5 Replies
View Related
May 24, 2007
i m developping a smart device application with vb.net
i m using the following code from:
http://msdn2.microsoft.com/en-us/library/aa454892.aspx
(i still working on the first exercice and i'm following it step by step)
everything is working properly
i was advised to add this code when closing the form1
Try
Me.ContactsBindingSource1.EndEdit()
Me.ContactsTableAdapter1.Update(Me.TestDataSet1.contacts)
MsgBox("Update successful")
Catch ex As Exception
MsgBox("Update failed")
End Try
the problem is:
should this code update the database created with sql server 2005
if yes why isnt it working here
and should the database be replicated on my emulator before it is updated
(in this exercice i do not have a database storerd in the emulator)
plz i urgently need the answer
View 4 Replies
View Related
Jul 4, 2006
Trying to develop a smart client which will have data centric approach for storage of local data. The server is SQL Server 2000 and foot print database is going to SQL Server Express 2005. Is Merge replication a vaiable option. Can somebody guide me on this approach
Is there any other architecture proposed for Smart client arcjitecture where the data tranfer will be in a couple of GBs. Can somebody tell me more about SOA as well
Thanks!
View 4 Replies
View Related
Jul 20, 2005
What is the best way to compare two entries in a single table wherethe two fields are "almost" the same?For example, I would like to write a query that would compare thefirst two words in a "company" field. If they are the same, I wouldlike to output them.For example, "20th Century" and "20th Century Fox" in the companyfield would be the same.How do I do this? Do I need to use a cursor? Is it as simple as using"Like?"
View 2 Replies
View Related
Jul 5, 2006
Hi
I have created a Smart device application for Windows CE 5.0 device using Visual studio 2005 and i have added the smart cab project to the solution. When I add project out in teh appllication folder, the detected dependencies are not included. Instead dependent files appear with red circle in solution explorer.
My project uses .Net Framework 2.0 and SQL Server mobile 2005 and SQL Server mobile database file and some symbol files
I need included all of them in my cab project and when user clicks on it (in the device) it should install all of them.
Let me know why detected dependencies are not included in the Cab project and how can get all the above mentioned things to be installed along with my program
Regards
Mani
View 4 Replies
View Related
May 30, 2007
I'm using an Aggregation task to summarize an input file by item and week before inserting it into a SQL table.
Two of the fields I'm summing, because their totals per record can occasionally exceed 32k, are defined as int (I4) instead of smallint (I2). However, the summarized total never exceeds the value an int can hold.
I ran into a problem on the insert, however, with SSIS telling me it couldn't insert an I8 value into an I4 table field. I discovered the metadata for the summed totals had automatically been set to bigint (I8), and the mapping was failing.
I didn't see a way to change that metadata within the Aggregation task itself, so I added a Data Conversion task to convert the totals to four-byte signed integers and enable the mapping. Was that the proper workaround?
View 1 Replies
View Related
Oct 9, 2006
Hey all,
Cool place! Has anyone deployed SQL Express silently using one click and an attached a smart client DB from within the app ... would love to see some of the best practices or horror stories! Just kidding... :) I'm about to deploy a smart client using SQL Express and could use some tips from someone who has been there.
Thanks in advance,
Bill
View 7 Replies
View Related
Feb 19, 2008
I have both vs2005 and vs2008 installed. I'm working with a .Net Compact Framework 3.5 Smart Device Project.
If I refrence the System.Data.SqlClient.dll (Version 3.0.3600.0 Runtime v2.0.50727)
C:Program FilesMicrosoft SQL Server Compact Editionv3.5DevicesClientSystem.Data.SqlClient.dll
When I deploy the application I get an error ".Net Compact Framework v2.0 could not be found Please install it and run the setup again"
Studio is :
Deploying 'C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerClientv2.0wce500ARMV4isql.ppc.wce5.armv4i.CAB'
We tested this on a PC without vs2005 and it seems to work fine.
Any suggestions?
jlj
View 3 Replies
View Related
Jan 14, 2004
Here is what I want to do.
I have a database with HotelInfo
hotelid
hotelname
hotelstate
hotelcity
hotelphone etc etc
I want to display all hotels I have grouped by state
SELECT hotelname, hotelcity, hotelphone
FROM HotelInfo
GROUP BY hotelstate
So basically I was For eg.
TX
hotel1 Dallas xxx-xxx-xxxx
hotel4 Plano xxx-xxx-xxxx
CA
hotel2 San Fransisco xxx-xxx-xxxx
How can I group by without Aggregation ?
View 5 Replies
View Related
Feb 21, 2003
Hi.
i have a problem that related to aggregation functions.
i have a table (requests)that consist with the following fields:event_id, request_type,data.
i want to present a report that for each event_id it will show the number of records where the request_type value is:"VMR".
i wrote the following query-
SELECT event_id, Count(request_type)
FROM requests
WHERE ((requestType)="VMR")
GROUP BY event_id
the problem is that:if event_id don't has a record with the value "VMR" it will not be showen in the report and the goal is to present those kind of events with the value 0.
who can i make it happen.
thanks.
View 6 Replies
View Related
Jul 20, 2005
Can anyone help me with an problem I have come across in my databasedesign.I have a primary table and a related table with 3 child records (eachwith a numeric field). I require a query to return the primary keyfrom the main table and the PRODUCT (i.e. all numeric valuesmultiplied together) of the three child records, much like a SUM wouldadd them together.Any help would be gratefully received!Tony.
View 3 Replies
View Related
Jun 14, 2007
Hello,
I have a matrix where I count number of employees per country, per product line.
The calcul is a simple sum :
(sum(Fields!ID__T_E_Employee_Distinct.Value)).
My report is correct at week level:
March 2007
W9 W10 W11 W12 W13
Product_Line1 17 17 17 17 17
Country Product_Line2 4 4 5 5 5
Product_Line3 25 25 26 25 25
Product_Line4 12 12 12 12 12
However my report is false when I drill-up to month level.
I obtain:
March 2007
Product_Line1 85
Country Product_Line2 23
Product_Line3 126
Product_Line4 60
but I want to obtain:
March 2007
Product_Line1 17
Country Product_Line2 5
Product_Line3 26
Product_Line4 12
For information, my datasource is an OLAP cube.
I have tried to add scope in the sum function but it doesn't work...
Moreover the sum is mandatory for me at week level, but I can have max of the sum at month level.
How to do max of sum in SSRS (I can have only one aggragation function in an expression).
Any help is welcome.
Thanks.
Guillaume.
View 2 Replies
View Related
Aug 6, 2007
Hi,
I am new to the reporting services and I've been working on problem in one of my reports all day long and after 8 hours of frusturation I decided ask for a profesional help.
Ok here is my problem: I have a report that calculates the amount of meetings with our clients. The dataset contains an activity_id field that we assign for each our meetings with our clients. SSRS counts these meetings and shows it in a drilldown enabled report. Everything seems fine on the report except that someof the activities involves few different clients and SSRS is not counting the activities multiple times in region drilldown as there is only one activity id associates in that region even though it contains different companies. And I want those companies to be calculated in too.
From the crude drawing below I wanted to explain my dilemma visually. As it can be seen the total number of meetings we had is actually 40. But as we had 3 activities that involves more than 1 clients it only gives 37 as a count. I would like to know is there a way to make the report count the same activity multiple times if activity_id is associated with more than one clients.
I hope I managed to explain my problem
**********************************************************************************************
Manager Region Market Company Meeting Detail
+Manager 1 (9 meetings)
+Manager 2 (37 meetings)
- West (37 meetings)
-Denver (37 meetings)
+Company 1 (5 meetings)
+Company 2 (2meetings)
+Company 3 (2meetings)
+Company 4 (3meetings)
+Company 5 (0meetings)
+Company 6 (0meetings)
+Company 7 (5meetings)
+Company 8 (1meetings)
+Comapny 9 (19meetings)
+Company 10 (3meetings)
Total (40 meetings)
View 5 Replies
View Related
Apr 10, 2008
I know we can design Aggregation usage for a dimension within a cube. For example, you can choose Full , None, Unrestricted and Default method. I assume this is the Global settings.
Is it possible that Ican do the same thing for the attributes within a dimension? I cannot find such property in attributes. Does this means we can't control which attributes we want Analysis Services to aggregate in a dimension?
View 6 Replies
View Related
Jul 3, 2007
Hi all
i need to create aggregation table from 2 tables group by date, any one have any idea how to create it by using SSIS
thanks & regards
View 1 Replies
View Related
Oct 29, 2006
Hi,
I have the following three tables :
Account (Id int, AccountName nvarchar(25))
Role (id int, Rights int)
AccountRole (AccountID, RoleID)
In Role table - Rights Column is a bit map where in each bit would refer to access to a method.
One account can be associated with multiple roles - AccountRole table is used for representing the N:N relation.
I want to develop a store procedure - which would return all AccountName and their Consolidated Rights.
Basically I want to do a BitWise OR operation for all the Rights in the Aggregation instead of the SUM as shown in the following statement.
SELECT Account.Name, SUM(Role.Rights) FROM Account WITH (NOLOCK)
JOIN RoleAccount ON RoleAccount.AccountID = Account.Id
JOIN Role ON RoleAccount.RoleId = Role.Id
GROUP BY Account.Name
Thanks,
Loonysan
View 6 Replies
View Related
Jun 28, 2015
I have a table imported from a legacy Oracle database that stores values vertically in name/value pairs. I store it in table-type variable that is an exact copy of the structure:
DECLARE @OracleEngData TABLE
( DataSourceCHAR(8)
, [OMNI_NUMBER] INTEGER
, [TIMESTAMP] INTEGER
, [DATA_TYPE] NVARCHAR(24)
, [PARAMETER] NVARCHAR(32)
, [PARAMETER_VALUE] NVARCHAR(132));
If this information were pivoted horizontally: OMNI_NUMBER would be the primary key.
TIMESTAMP is a 10-digit integer that represents the number of seconds since 1/1/1970 UTC that requires additional conversion. DATA_TYPE is not the data type. It is a general categorization of the next two columns.PARAMTER would be the column headings if it were horizontal..PARAMETER_VALUE would be the data value in that column.
I would like to try to use PIVOT to list the PARAMETER column values as column headers. This seems to work fine. What's confusing me is that I'd like it to list the PARAMETER_VALUE column values as raw data, just as it is in the source version, without having to apply some sort of aggregate function to it. Here's a CSV sample of the data you can paste into Excel. I'm trying to transform this:
OMNI_NUMBER,TIMESTAMP,DATA_TYPE,PARAMETER,PARAMETE_VALUE
506026,1413240436,test_data,cnr,211250000,54.8
506026,1413244259,test_data,cnr,211250000,53.2
506026,1413244679,test_data,cnr,211250000,53.1
506026,1413309646,test_data,cnr,211250000,53.4
506026,1413315987,test_data,cnr,211250000,53
[code]...
But I don't want the sum of the values or the average of the values, just the values. The PIVOT syntax seems to require an aggregate operation.
View 2 Replies
View Related
Sep 27, 2007
Hello,
I have a Sales cube and I want to be able to display Products and the
Price at which they were purchased in a given period. I have a
Product dimension while Price is a measure in my Sales Fact Table. Is there a way to have a "Group By" aggregation instead of a Sum? This way, I can show Products grouped by their list price.
My Product Dimension consists of product_numbers (such as 100, 101,
102 etc...)
My Sales Fact Table consists of sales data (such as product_key,
price, net_sales, returns, etc...) at the transaction level.
I want to be able to view the data like this:
Price Net_sales Returns
Product
100 $5.99 $2005 $320
101 $3.51 $7110 $998
where Net_sales and Returns are "summed" and Price is simply a "Group
By". In other words, this report would show the net sales and returns
by product for a given price.
I'd rather not use a Price dimension since we have hundreds of
products at hundreds of different prices. Moreover, this data is
already in the Sales Fact table.
Thanks for any help provided
View 1 Replies
View Related
Feb 7, 2006
I am trying to port a database from SQL Server 2005 Express to SQLServer 2005 Standard. Idetached my database from the SQL Sever 2005 Express instance andattached it to the SQL Server 2005 Standard instance. Whenever I do aselect on tables in the database I have no problem. However if Iattempt to open or modify a table by selecting open or modify from thepopup menu, I get the following error --TITLE: Microsoft SQL Server Management Studio------------------------------Class does not support aggregation (or class object is remote)(Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))(Microsoft.SqlServer.SqlTools.VSIntegration)------------------------------BUTTONS:OK------------------------------I tried repairing the .NET 2.0 framework but to no avail.Please help!!!Thanks,
View 3 Replies
View Related
Mar 29, 2007
Hello, I have a resultset as follows:fields: Name, RankIDvalues:Prorduct A, 4Product B, 33Product C, 221(etc)Name is always unique. RankID may not be.I want to take that result set and basically pivot it to have the Namevalues as columns, and the RankID of each one as the data. So youwould end up with only one row like:Product A | Product B | Product C | etc4 | 33 | 221 | etcIs this possible? I do not want to sum the data or anything, simplyrotate it sort of.Any advice is appreciated.
View 3 Replies
View Related
Jul 24, 2006
I need to create a report containing the headcounts of the employees for each month. The data I can retrieve from the database looks like this:
Name
StartEmp
EndEmp
tom
1/jan/05
15/mrt/05
dirk
1/jan/05
31/mrt/06
jan
1/feb/05
NULL
In order to get the right information for the report the information should be represented in the following way:
January 2005
February 2005
March 2005
"April" 2005
Tom
1
1
0,5
1
Dirk
1
1
1
1
Jan
0
1
1
1
HeadCount
2
3
2,5
3
(there should be more data in the 2nd table but it's a sliced representation of the data. Sliced by 2 report parameters: startdate (=1 January 2005) and enddate (=30 April 2005) )
I need some help about building up the query to aggregate the info from table1 to the format of table2.
View 4 Replies
View Related