Forum Replies Created

Viewing 15 posts - 676 through 690 (of 3,957 total)

  • RE: Discussion About Cross Tabs

    I'm not sure exactly what you want here as I see no definition of Delay or Frequency.

    It does look like you're trying to get all columns in Feb (or whatever...

  • RE: SQL Function to remove excess characters

    Junglee_George (3/11/2014)


    dwain, your code is superb one..

    Please write the UPDATE syntax also, if want to update the column.

    Do you mean like this?

    WITH SampleData (OrderNo) AS

    (

    SELECT 'SO-123456'...

  • RE: Pivot and Unpivot in same query

    Junglee_George (3/11/2014)


    Dwain, nice way of doing it..!!

    Is this a kind of cross-tab.??

    Actually, the CROSS APPLY VALUES is a bit of an UNPIVOT (see the first link in my signature articles)....

  • RE: Are the posted questions getting worse?

    Jeff Moden (3/11/2014)


    Greg Edwards-268690 (3/10/2014)


    Luis Cazares (3/10/2014)


    Lynn Pettis (3/10/2014)


    If any one has some free time this person could use some help. I don't have the free time at the...

  • RE: Discussion About Cross Tabs

    born2achieve (3/10/2014)


    Hi Dwain,

    Thanks for your reply and i ran your logic. you have built logic just for as per my expected result. But i have gave some test data for...

  • RE: Matching Closest Time between two columns between tables

    WITH BabyTemp (Baby, DT, Temp) AS

    (

    SELECT 1, '2013-03-11 08:45', 98.6

    UNION ALL SELECT 1, '2013-03-11 11:15', 98.7

    UNION ALL SELECT...

  • RE: get the first date and weekday of every month in a year

    There's an example in here: Calendar Tables in T-SQL[/url] that shows how to calculate the last work day of the month ("pay day"), which is not too dissimilar to your...

  • RE: Discussion About Cross Tabs

    CREATE TABLE #GrocessaryStore

    (

    IdGrocessaryStore int Primary key

    ,Name varchar(50)

    ,GrocessaryStoreDelay int

    ,DataFrequency int

    ...

  • RE: Can recursive CTE solve a Tiering problem?

    It might be overkill for you or it might be just what you need. Check out Jeff Moden's two articles "Hierarchies on Steroids:"

    Part 1[/url]

    Part 2[/url]

    Be advised that this is...

  • RE: Parsing out a string field

    You can also do this using Cascading CROSS APPLYs:

    WITH SampleData (Str2Split) AS

    (

    SELECT 'ELA-DUPLECHEIN, KELLIE-13-14-2(A-B)'

    UNION ALL SELECT 'READING -LANDRY, MICHELE B-13-14-2(A)'

    )

    SELECT Str2Split, s2

    FROM...

  • RE: How to add up the monthly total?

    Jeff Moden (3/7/2014)


    MyDoggieJessie (3/7/2014)


    To add to SQLCJ's post, you will need to include the ORDER BY date_value at the end to get the OP's expected result - and some ugly...

  • RE: avoid self join

    No self JOIN required if you do it like this:

    SELECT batchid

    ,empsal=MAX(CASE WHEN rn=1 THEN empsal END)

    ,paiddate=MAX(CASE WHEN rn=1 THEN paiddate END)

    ...

  • RE: Are the posted questions getting worse?

    SQLRNNR (3/7/2014)


    dwain.c (3/6/2014)


    TomThomson (3/6/2014)


    Koen Verbeeck (3/6/2014)


    MysteryJimbo (3/6/2014)


    Koen Verbeeck (3/5/2014)

    Pfff, than you have never been in Belgium before 😀

    If we wouldn't be having the most traffic jam congested cities in the...

  • RE: Are the posted questions getting worse?

    Ed Wagner (3/7/2014)


    dwain.c (3/6/2014)


    TomThomson (3/6/2014)


    Koen Verbeeck (3/6/2014)


    MysteryJimbo (3/6/2014)


    Koen Verbeeck (3/5/2014)

    Pfff, than you have never been in Belgium before 😀

    If we wouldn't be having the most traffic jam congested cities in...

  • RE: recursive Stored procedure or function

    Scratch that previous post. Coffee deficit disorder.

Viewing 15 posts - 676 through 690 (of 3,957 total)