Forum Replies Created

Viewing 15 posts - 12,571 through 12,585 (of 26,486 total)

  • RE: pivot both horizontally and 'vertically'

    Instead of what you posted, how about this:

    create table dbo.WorkItems

    (workitem_id int

    , app varchar (20)

    , resolution_reason varchar(20)

    , severity int

    , date_opened datetime

    )

    insert into dbo.WorkItems

    values

    (20, 'hearts', 'deferred', 1, getdate()-30),

    (21, 'spades', 'deferred', 1,...

  • RE: Counts in case statement

    Not quite sure what you are attempting to accomplish based on your post. It would help if you would take the time to read the first article I reference...

  • RE: pivot by year using datetime column

    polkadot (4/22/2012)


    Jeff, can I use cross tabs (or pivot) to aggregate by both Year and Quarter horizontally and by application vertically?

    I would say that it would create such a wide...

  • RE: How to create multiple users using a procedure with a loop

    SQLServerCentral.com is a MS SQL Server site. Your code is Oracle and you will probable get much better help from a site that is Oracle centric.

  • RE: pivot against two different columns

    Missed where your syntax error was caught. But as I looked at what you wanted next, does the following work:

    create table dbo.WorkItems

    (workitem_id int

    , app varchar (20)

    , resolution_reason varchar(20)

    )

    insert into...

  • RE: pivot against two different columns

    polkadot (4/22/2012)


    I have a working pivot statement, which pivots againts one column. I'm trying to create some ddl to model it so that I can ask how to do...

  • RE: pivot by year using datetime column

    I'd say your problem is that your code is syntacticly incorrect. You may want to review the PIVOT operator in Books Online.

    Below is what I was able to come...

  • RE: sql

    Looking at this post, it is a bit more difficult to know what you are trying to accomplish. Looking at the data, however, I was able to make a...

  • RE: sql discusion

    First, you are fairly new here, so one thing you should do is read the first article I reference below in my signature block. It will show you what...

  • RE: Concatenate today's date and tomorrow's date

    Which of the following do you want?

    select CONVERT(varchar(10), getdate(), 102) + '.' + CONVERT(varchar(10), dateadd(dd,datediff(dd,0,getdate()) + 1,0),2);

    select CONVERT(varchar(10), getdate(), 102) + '.' + CONVERT(varchar(10), dateadd(dd,datediff(dd,0,getdate()) + 1,0),102);

  • RE: SQL request performance problem

    I'd suggest hiring someone more experienced with MS SQL Server to help you on your project.

  • RE: how to join 2 temp table into 1

    riya_dave (4/20/2012)


    can i do something like this

    create table #temp4(account INT,

    monthirr FLOAT)

    it gives syntax error

    INSERT INTO #temp4

    (select account ,(select i1 from account(p1) phd

    union

    select MTD from #temp2)...

  • RE: Help in Getting Closing Balance from Opening balance

    Here is what you are trying to accomplish:

    create table Opening([Date] date,item_id int,location_id int,qty int)

    Insert into Opening

    Select '14-Mar-2012', 75 ,36 ,1

    Union

    select '14-Mar-2012', 75, 43, 1

    Union

    select '29-Mar-2012' ,75, 43, 3

    Union

    select...

  • RE: I need help on writing a query that returns a two column rowset

    deebabat (4/21/2012)


    Here is a better one

    DECLARE @num INT = 102

    SET STATISTICS TIME ON;

    SET STATISTICS IO ON;

    ;WITH

    L0 AS(SELECT 1 AS c UNION ALL SELECT 1),

    ...

  • RE: I need help on writing a query that returns a two column rowset

    deebabat (4/21/2012)


    Lynn, thank you so much!

    Here is another method I tried and it's worked just fine.

    DECLARE @num INT = 1000000

    SET STATISTICS TIME ON;

    SET STATISTICS IO ON;

    ;WITH

    L0...

Viewing 15 posts - 12,571 through 12,585 (of 26,486 total)