Hi, Is it possible to create a dynamic alias name based upon a field value?
For exp:
Select id,
case when month=1 then cnt_of_tkts end as month
,case when month=2 then cnt_of_tkts end as month
,case when month=3 then cnt_of_tkts end as month
from
mytable;
Here month is a column name of a table...
Hi Guys, I am on a tight deadline and would really appreciate if you guys can provide some input. I am using SQL Server 2005.
I have following table:
Year Dept Month Tkt_Cnt
2008 R&D 02 2
2008 R&D 03 5
2008 R&D 01 6
2007 R&D 06 3
2007 HR 05 8
2007 HR...
Hi, Is it possible to create an alias from a concatenation of a column and a string or another column? For exmple:
Select ID + ' ' + FName as ID +'2008XYZ'
from employee;
Result: (say ID=1001)
10012008XYZ <--- column alias
1001 John <--value
I have trid but getting errors. I am using...
Hi guys, I have a sample table like the following:
Unit, Year , SubUnit , Category , Jan_Cases Feb_Cases , March_Cases... Dec_Cases
I have data for multiple years. I need to select data based upon current month -12 months. For example if current month is March, then the resulting columns...
I am trying to create a report in CR2008. The database is SQL Server 2005. The report is pulling data from one table that has say 10 columns and some columns are defined as xml datatype. All the xml columns are appearing as a memo fields on the report.
I want to be able to do a record selection...
Hi guys, I have a report in which I am currently displaying dynamic color of rows by this formula:
//@dynamic color
if (recordnumber mod 2) = 1
then
crwhilte
else
crsilver)
It works fine but only if I don't supress duplicate records. But it does not work when I use this formula to supress...
Hi Guys, I am on a tight deadline. I have a query that returns data similar to the following:
State City JanSum FebSum MarSum... DecSum
CA LA 1000 500 300 ... 200
CA SF 500 500 200 ... 300
TX Dallas 300 100 50 ... 150
TX...
Hi, I have a table whose data is in the following format:
ID Column1 Value1
1 State California
1 City Los Angeles
1 Dept HR
1 EmpCount 50
2 State New York
2 City New York
2 Dept Accounting
2 EmpCount 30
2 SubDept...
Hi, I have a report that has two parameters. The first parameter is a static, say with 'By Location', and 'By Departement' values.
Now, the second parameter is supposed to display values based upon selection in the first parameter. If first parameter is location, then the second parameter should...
Hi, I have this dyanamic query in which I want to show the value of a variable @val1 as the column heading.
Declare @val1 varchar(20)
Select @val1='City'
Select id,
case
when table1.field1 = @val1 then table1.field2
end as 'xxxxxxxx' (this should be the value of @val1)
from table1
The result...
Hi, I would like to know which one is more efficient way of bringing data in a report between a command object and using tables (linking expert) directly. And if any pros and cons of using command vs tables or tables vs command. thanks in advance.
I am thinking about starting an IT consulting business. During my 8 year IT programming history, I have worked both as a conractor and a full time employee. Now I am thinking about starting a consulting business and marketing myself as a contractor through my own company. Basically I want to...
I can't believe there is no warning sign when opening an older version files in a higher version. I recently had to modify one report that was in v8.5 for one client. On my machine I have both v8.5 and 9.0. I double clicked the 8.5 report file and it opened in v9.0. I thought that the file was...
I have developed a report in v9.0. The report initially used a different table, say tableA. I changed the datasource location and pointed to to tablB. However in the 'Field Explorer' window I still see tableA. In version 8.5, it used to automatically change and we could also alias the table name...
I have this query and I want to know if its possible to write it without a UNION clause.
select id from table_a
where
(name='Atlanta' And locations In ('1' ,'2','3') )
union
select id from table_a
where
(name='Los Angeles' And locations In ('11' ,'12','13')).
Basically I only want those ids...
I am using crystal 9 to develop a x-tab report. The required layout is as follows:
Apr ... and so on for 12 months
Mar P#014(2) P#010(13),P#001(15)
Feb P#010(12),P#012(15) None
Jan P#002(5),P#003(40), P#001(6)
P#001(45)
2005...
(sorry... I posted this topic earlier in a wrong forum and I am copying it here.)
I am using SQL Server to write a simple select query that should fetch all records on same row, instead of multiple rows. For example:
The data is:
ID PlanName Year
1001 AP_Q1 2006
1001 AP_Q2...
I am using SQL Server to write a simple select query that should fetch all records on same row, instead of multiple rows. For example:
The data is:
ID PlanName Year
1001 AP_Q1 2006
1001 AP_Q2 2006
1001 AP_Q3 2006
1001 AP_Q4 2006
And I want this out put:
ID...
I need to write a simple query that achieves following results.
Data in a table say Table1.
EmpID StartDate CurrentStatus Grade
10001 04/01/2006 A Null
10001 05/01/2006 Null G-A
The result set that I expect should look like following in one row...
I have a requirement to move data from schema1 to schema2 on same oracle 9 server. The tables in schema2 have less number of columns as in schema1. For example schema1.table1 has 10 columns and shema2.table1 has 7 columns. I am debating whether I should use an ETL tool to do that or write a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.