Forum Replies Created

Viewing 15 posts - 4,561 through 4,575 (of 10,144 total)

  • RE: Join to Calendar Table

    Something like this?

    SELECT LoadsOfStuff

    FROM AnotherTable a

    INNER JOIN [dbo].[Calendar] c

    ON a.aDate BETWEEN c.FirstDateOfWeek AND c.LastDateOfWeek

    AND c.CalendarDate = CAST(GETDATE() AS DATE)

  • RE: Random Number Generator

    TheSQLGuru (6/3/2013)


    It's quicker to write FROM x a, x b than it is to track down the inline tally table code.

    That's what Snippets are for silly! 😀 Actually...

  • RE: Random Number Generator

    TheSQLGuru (5/24/2013)


    ChrisM@Work (5/23/2013)


    Bex (5/23/2013)


    Nice solution btw, Chris.

    Bex

    Gosh, thanks! :blush:

    It truly is an elegant solution Chris! Kudos.

    However, I will nit-pick on using sys.columns for the driver. 😎 That...

  • RE: query to search

    Rauf Miah (6/3/2013)


    I have a table with fields and data type like

    companycode [nchar(4)] actcode [nchar(12)] vounum [nchar(14)] trnam [decimel (18,6)]

    I like to build...

  • RE: selecting Distinct value in a column based on values another column.

    Rather than posting the solution, here's an excellent spackle article by Jeff Moden which explains how to do this and extends the functionality too:

    http://www.sqlservercentral.com/articles/T-SQL/88244/%5B/url%5D

    Reading the article will cost you about...

  • RE: Random Number Generator

    Bex (5/23/2013)


    Nice solution btw, Chris.

    Bex

    Gosh, thanks! :blush:

  • RE: Random Number Generator

    Bex (5/23/2013)


    if you have a comment mark before the last line

    eg --) l9 rather than just ) l9

    If I comment out the last line,...

  • RE: Random Number Generator

    todd.ayers (5/22/2013)


    Well,

    I have finally had a chance to test this and I keep getting an error message saying:

    Msg...

  • RE: Random Number Generator

    dwain.c (5/22/2013)


    ...

    That is a brilliant solution Chris!

    And here I thought when I pulled up this thread I could make a shameless plug for my random numbers article (in my signature).

    Thanks...

  • RE: Random Number Generator

    todd.ayers (5/22/2013)


    Well,

    I have finally had a chance to test this and I keep getting an error message saying:

    Msg...

  • RE: Are the posted questions getting worse?

    GilaMonster (5/22/2013)


    ChrisM@Work (5/22/2013)


    Is it just me or is there really a hike in hideously BS answers this week? Not on this thread of course, the "worker threads"

    Yes. Very much...

  • RE: Are the posted questions getting worse?

    Is it just me or is there really a hike in hideously BS answers this week? Not on this thread of course, the "worker threads" (ahem).

    Brandie, I read your account...

  • RE: SQl Server 2008 Query Performance

    sivaraman8282 (5/22/2013)


    thanks Newbie. I removed nvarchar field(T.Name) from group by area. Now, the performance is good compare to previous one.

    Be careful with the conclusions you draw from this because if...

  • RE: SQl Server 2008 Query Performance

    e4d4 (5/22/2013)


    It depends, you did not give tables definition and actual execution plan, but this query looks like a good candidate to try indexed views.

    Can you explain why? This is...

  • RE: How to make my number shorter??

    karim.boulahfa (5/22/2013)


    I dont get any valuas out the Query ??

    It's very difficult to rework someone else's code without data to run the code against. That's why I wrote "Something like...

Viewing 15 posts - 4,561 through 4,575 (of 10,144 total)