Forum Replies Created

Viewing 15 posts - 1,561 through 1,575 (of 2,452 total)

  • RE: sorting by month with current month at top

    bit late......

    SELECT DATEPART(mm, OrderDate) AS MonthNum, AVG(orderCount) AS AvgOrderCount

    FROM OrderTest

    GROUP BY DATEPART(mm, OrderDate), DATEADD(mm, DATEDIFF(mm, 0, OrderDate), 0)

    ORDER BY DATEADD(mm, DATEDIFF(mm, 0, OrderDate),...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: edit SQL tables directly from Excel

    http://www.toadworld.com/platforms/sql-server/w/wiki/10392.editing-an-sql-server-table-in-excel.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Need Scripts

    OnlyOneRJ (10/12/2013)


    I downloaded Brents script.. its huge & didnget which to use from them..

    can anyone help me with scripts one by one for below need 🙁

    1) Script to Identify what...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Need Scripts

    ??....why the "shouting"?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: SELECT Statement against view takes 3 seconds on one machine and 1:10 on others

    Welsh Corgi (10/11/2013)


    I'm sorry but Proprietary information would be disclosed if I posted the execution plan.

    So consider this post closed.

    btw, it is slow for EVERYONE except the developer that created...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: how to split the comma delimited string into rows without using LOOP, CTE, XML.

    LutzM (10/9/2013)


    Why did you open another thread?

    What about the answers already provided here?

    that post was to split into columns.....now it seems into rows.....

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: split a comma delimited string into columns

    I could be mistaken but it does look like there's a chance for SQL Injection in the dynamic use of the @Pivot variable, though. Correct me if I'm...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date range query problem

    briancampbellmcad (10/8/2013)


    I'm trying to find all the records that are 1 week before today and 3 weeks after today including today.

    try here

    http://www.sqlservercentral.com/Forums/Topic1418640-392-1.aspx

    🙂

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date range query problem

    Sean Lange (10/8/2013)


    briancampbellmcad (10/8/2013)


    I put in WHERE (tbl_pac2k.[Installation Start Date] > DATEADD(DAY, -7, [Installation Start Date])) AND (tbl_pac2k.[Installation Start Date] < DATEADD (DAY, 21, [Installation Start Date]))

    into my embeddded query...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date range query problem

    are you MYSQL by any chance.?..this is Microsoft SQL forum

    maybe someone else will chime in....

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: query to concatenate/pivot? base on group by

    SELECT

    id1,

    id2,

    STUFF(

    (

    SELECT ',' + prodID

    FROM t p2

    WHERE p1.id1 = p2.id1

    AND p1.id2 = p2.id2

    ORDER BY p2.prodID

    FOR XML PATH('')),1,1,' ') ProdIds

    FROM t p1...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Setting out Database Mail when Office 365 is involved

    does this help?

    http://blogs.technet.com/b/meamcs/archive/2013/02/25/how-to-configure-sql-database-mail-so-send-emails-using-office-365-exchange-online-a-walkthrough.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: split a comma delimited string into columns

    Hello

    please see some code (still work in progress) below

    the idea is to strip a csv column into separate columns:

    the number of columns is indeterminate as is the length of the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Need Help on Fastest Search Logic

    born2achieve (10/1/2013)


    Hi Livingston,

    thanks for your time on this and i have tried whatever you have shown couple of days before, the problem is time consuming and how to fasten the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Need Help on Fastest Search Logic

    you appear to want to match "corn" with "cornil"...is this correct?

    some set up data to play with,,,,,

    CREATE TABLE [dbo].[Table1] (

    [id] [bigint] NULL,

    [product_name] [nvarchar](1000) NULL,

    [quantity] [int] NULL

    ) ON [PRIMARY]

    CREATE TABLE [dbo].[Table2]...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 1,561 through 1,575 (of 2,452 total)