Forum Replies Created

Viewing 15 posts - 4,531 through 4,545 (of 8,753 total)

  • RE: One of the most complex Views i have ever seen (View nested into another view)

    SQLPain (9/14/2015)


    This happens to be a view query that needs to be run every night, needs to be converted to an excel file and email the attachment to couple of...

  • RE: The checksum

    he he, how to tell when?

    😎

  • RE: Query Optimization/Cleanup

    john_rowles (9/14/2015)


    The query returns the data that I need, but it looks rather sloppy. There are only a few hundred rows in the table at the moment, but expect...

  • RE: Round

    SQL-DBA-01 (9/14/2015)


    V strange

    if you try any of the below, the results will be:

    "Msg 8115, Level 16, State 2, Line 1

    Arithmetic overflow error converting expression to data type numeric."

    SELECT round(.999,0);

    SELECT round(.999,1);

    SELECT...

  • RE: One of the most complex Views i have ever seen (View nested into another view)

    Sorry, slightly hurried and inaccurate

    😎

    CONVERT(DATE,AppDetails.DateDetailDisposed,0) = CONVERT(DATE,DATEADD(DAY,-21,getdate()),0)

  • RE: Calculate total between two columns

    kdejan87 (9/14/2015)


    No, this is my starting point:

    CREATE TABLE #NONAMETABLE(

    ID INT

    ,column1 INT

    ,column2 int

    );

    INSERT INTO #NONAMETABLE(ID,column1,column2) VALUES

    (1,100.00,40)

    ;

    drop table...

  • RE: One of the most complex Views i have ever seen (View nested into another view)

    SQLPain (9/14/2015)


    Thanks Again, but this one is giving me all the results from the last 25 days till today...

    why do we need a between clause if I only need records...

  • RE: sql syntax error

    Just remove the arbitrary opening parenthesis

    😎

    CREATE VIEW abcd AS

    SELECT

    a.description,

    a.corporate_tag,

    a.corporate ,

    a.banner_tag,

    a.banner,

    a.region_tag,

    a.region,

    a.division_tag,

    a.division,

    a.hierarchy_level,

    a.load_id,

    a.process_name,

    a.loop_id,

    ( case WHEN b.corporate_tag IS NULL or b.banner_tag IS NULL THEN 'I' Else 'U' END )

    /* or ( case...

  • RE: One of the most complex Views i have ever seen (View nested into another view)

    SQLPain (9/14/2015)


    Thanks Errikur,

    I only want results from past 21 days, I tried this also:

    AppDetails.DateDetailDisposed = DATEADD(DAY,-21,getdate())

    Still gives me a blank result set

    Missed the 21 days:-P

    😎

    AppDetails.DateDetailDisposed BETWEEN CONVERT(DATE,DATEADD(DAY,-25,getdate()),0) AND CONVERT(DATE,getdate(),0)

    Note, convert...

  • RE: Calculate total between two columns

    Slightly different approach from JLS's

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    GO

    DECLARE @SAMPLE_DATA TABLE

    (

    column1 NUMERIC(12,2) NOT NULL

    ,column2 NUMERIC(12,2) NOT NULL

    );

    INSERT INTO @SAMPLE_DATA(column1,column2)

    VALUES ...

  • RE: One of the most complex Views i have ever seen (View nested into another view)

    SQLPain (9/14/2015)


    Thanks Scott,

    How do I fix this code:

    AppDetails.DateDetailDisposed BETWEEN getdate() - 25 AND getdate() - 20

    I only need getdate() -21, but that's giving me blank output

    Use DATEADD

    😎

    AppDetails.DateDetailDisposed BETWEEN DATEADD(DAY,-25,getdate())...

  • RE: OT, but... DAX Patterns 2015 database?

    pietlinden (9/14/2015)


    I looked there, but didn't see a link to download, so that's why I asked here. He explains the patterns, but without the database they're working from, I...

  • RE: OT, but... DAX Patterns 2015 database?

    pietlinden (9/14/2015)


    I'm reading Ferrari & Russo's DAX Patterns 2015 book, which is great, but I'm wondering about one thing... where is the database they're using for their examples?

    I just find...

  • RE: Commercial Software with All Tables as Heaps and Terrible Performance

    Wayne West (9/14/2015)


    Matt Miller (#4) (9/14/2015)


    Eirikur Eiriksson (9/14/2015)


    Jeff Moden (9/14/2015)


    Eirikur Eiriksson (9/13/2015)


    Using heap to speed the inserts is like a very bad Credit Card deal, no transaction fees but X000%...

  • RE: SSIS with dynamic quey

    nightowl23 (9/14/2015)


    i am modifying a SSIS package which contains SQL task, a dynamic query, and set the query as output parameter, it used to work last week, but today it...

Viewing 15 posts - 4,531 through 4,545 (of 8,753 total)