Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: yehong
  • Content: Threads
  • Order by date
  1. yehong

    how to dyanamically alias a column?

    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...
  2. yehong

    how tp PIVOT this 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...
  3. yehong

    can we create alias from concatenated columns?

    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...
  4. yehong

    how to select data for past 12 months from current date?

    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...
  5. yehong

    creating report from xml stored in database

    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...
  6. yehong

    dynamic color of rows

    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...
  7. yehong

    help in a sum query

    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...
  8. yehong

    need a store proc sample for this problem

    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...
  9. yehong

    displaying field values in a parameter dynamically-XI

    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...
  10. yehong

    Using variable as a column heading

    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...
  11. yehong

    using command vs tables in xi

    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.
  12. yehong

    corp to corp IT consulting business

    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...
  13. yehong

    mad at Crystal Decisions/Business Objects

    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...
  14. yehong

    Can't alias table name in V9.0

    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...
  15. yehong

    how can this query be written without a UNION clause?

    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...
  16. yehong

    need ideas about this manula x-tab report

    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...
  17. yehong

    how can this resultset be achived through a query?

    (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...
  18. yehong

    How can this resultset be achieved through a query?

    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...
  19. yehong

    Can a simple query achieve this result?

    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...
  20. yehong

    using an ETL tool vs an store proc to export/import data

    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...

Part and Inventory Search

Back
Top