Forum Replies Created

Viewing 15 posts - 5,221 through 5,235 (of 10,144 total)

  • RE: All Possible Combinations Loop

    akberali67 (2/9/2013)


    Ok, that does makes sense.

    Just one last question and I am sorry if I am bothering you. How much memory do you anticipate I would need to run...

  • RE: Calculating a Moving Average

    dwain.c (2/11/2013)


    ChrisM@Work (2/11/2013)


    Gabriel Priester wrote an article discussing the calculation of moving average. Various alternatives are covered in the discussion.

    A QU for moving averages??? :w00t: Who'da thunk it!

    It's almost as...

  • RE: Calculating a Moving Average

    Gabriel Priester wrote an article discussing the calculation of moving average. Various alternatives are covered in the discussion.

  • RE: All Possible Combinations Loop

    Or possibly this:

    -- GROUP BY ROLLUP and GROUP BY CUBE seem to be close.

    -- Neither can handle more than 12 columns ("variables") in one sitting

    -- 4 sample rows generate...

  • RE: How to Add Leading Zeros

    Are you trying to turn these three values into a time? Try this:

    SELECT

    d.SendTime / 360000 AS Hour,

    d.SendTime % 360000 / 6000 AS Minute,

    d.SendTime % 6000 / 100...

  • RE: Finding patterns in rows (date ordered)

    It's easy enough to fill in gaps. What you want to do after that is up to you. Here are a couple of ideas.

    SET DATEFORMAT YMD

    DECLARE @Shifts TABLE

    (staffid int,...

  • RE: Sort by/Order By

    Lynn Pettis (2/8/2013)


    Knowledge test for wafw1971.

    You do know that there is no guarantee on the order of the data returned by SQL Server if you don't have an ORDER BY...

  • RE: Sort by/Order By

    wafw1971 (2/8/2013)


    ... I have been told to hardcode like the Financial Month Section below.

    That would be

    01 January

    02 February

    03 March

    Are you sure you want to do this?

  • RE: Sort by/Order By

    wafw1971 (2/8/2013)


    ...

    SELECT DISTINCT CalendarMonth

    FROM Time3

    ORDER BY CalendarMonth

    I get January, February, March and not April, August, December.

    No. When you ORDER BY CalendarMonth, it will do exactly that, not what you automagically...

  • RE: All Possible Combinations Loop

    It's difficult to figure out exactly what you are looking for here, but I suspect that one or other of the GROUP BY extensions might just get you what you...

  • RE: Cursor

    Minnu (2/8/2013)


    Hi Team,

    - if cursor is not closed / deallcated, then below is the error msg

    Msg 16915, Level 16, State 1, Line 7

    A cursor with the name 'cur_emp' already exists.

    Msg...

  • RE: Need Help in Selecting Random and Non Sequential Data

    jeganbenitto.francis (2/8/2013)


    Okies, Now i get the Row Numbers from you query.

    But i have a small silly doubt again on this,

    How can i show the ID (which is more than 8...

  • RE: Merge statement with openrowset

    S_Kumar_S (2/8/2013)


    HI All

    Is it possible to run the MERGE statement using Openrowset or openquery? I tried with below statement:

    You want to run this MERGE as a remote query on SERVER=MYSERVER....

  • RE: Need Help in Selecting Random and Non Sequential Data

    Try this:

    ;WITH SampleData AS (

    SELECT ID = RIGHT('0'+CAST(n AS VARCHAR(2)),2)

    FROM (SELECT TOP 99 n = ROW_NUMBER() OVER(ORDER BY name) FROM SYS.columns) d

    ),

    CutOfSample AS (

    SELECT TOP(30) -- fetch more rows than...

  • RE: Need Help in Selecting Random and Non Sequential Data

    How many rows does the table have?

Viewing 15 posts - 5,221 through 5,235 (of 10,144 total)