Forum Replies Created

Viewing 15 posts - 5,986 through 6,000 (of 15,381 total)

  • RE: Last 3 months data

    Something like this?

    select *

    from YourTable

    where Time_Open > dateadd(month, datediff(month, 0, GETDATE()) - 4, 0)

    and Time_Open < dateadd(month, datediff(month, 0, GETDATE()) - 1, 0)

    --edit--

    Fixed a couple typos.

  • RE: Purge Process Help

    Glad that sounds like a plan that will work you. Make sure you test test test!!!

  • RE: Purge Process Help

    PrettyDBA (1/9/2014)


    Hi all,

    I am attempting to do a rather simple purge task on a very large table. This task will need to take place daily and delete records older...

  • RE: calculate tax

    Hi and welcome to the forums!!! It is considered best practice around here to post ddl and sample data in a consumable format. You can read about how to post...

  • RE: Proivde Hierechy wise sum and display all

    Shanmuga Raj (1/9/2014)


    Sean Lange (1/9/2014)


    Excellent job posting ddl and sample data. I can't understand what you want for output. I can't seem to figure out the relationship between these tables.

    I...

  • RE: Proivde Hierechy wise sum and display all

    Excellent job posting ddl and sample data. I can't understand what you want for output. I can't seem to figure out the relationship between these tables.

    I think that somehow in...

  • RE: Dataype question

    You would need to use datetime2 for that much precision in the time.

  • RE: How to pivot using pivot clause of sqlserver 2005 for three values

    Yes you have to use a cross tab. If you know the number of elements you can use a static cross tab. If the number of elements is not known...

  • RE: DIFFERENCE BETWEEN NOLOCK VS WITH(NOLOCK) IN SQL SERVER 2008

    NOLOCK is not a good habit at all. In fact query hints in general are a last resort and should only be used when you REALLY understand what they are...

  • RE: I need a query.. kind of hieararchy finding query

    dwain.c (1/8/2014)


    Sean Lange (1/8/2014)


    ...

    This gets almost what you state you are looking for. It does not return 80, 40 but I can't understand from your data why you think that...

  • RE: Question With Creating After Trigger

    Your join in the condition is different than the insert statement.

    IF EXISTS (SELECT 1 FROM INSERTED I JOIN DELETED D ON I.hMy = D.hMy )

    ...

  • RE: I need a query.. kind of hieararchy finding query

    You are basically describing a classic recursive cte situation but you have a twist in that the recursion can go both directions.

    Here is the basic cte.

    create table #temp (fileno int,...

  • RE: SQL Help needed...

    satishchandra (1/8/2014)


    Jeff, Here is the code for split function..

    Take a look at the link provided by Jeff above or the same link in my signature about splitting strings. In there...

  • RE: insert twice seems to pick up new id

    nick 91670 (1/8/2014)


    There are no loops, I make an update to the original record, then copy it to another table, I then make another update to the original record, then...

  • RE: Change code in all views

    Tara-1044200 (1/8/2014)


    can you please give me an example how to do that?

    To do which one? The SSMS idea is just to use find/replace in the application.

Viewing 15 posts - 5,986 through 6,000 (of 15,381 total)