Forum Replies Created

Viewing 15 posts - 1 through 15 (of 33 total)

  • RE: Syntax Validation

    Carlo Romagnano (4/7/2014)


    happycat59 (4/7/2014)


    SET NOEXEC might find syntax errors but it doesn't find all errors. I copied a piece of code that included a "RANK... PARTITION BY [invalid column]"...

  • RE: Logic Precedence

    david.wright-948385 (2/12/2014)


    Always add brackets when mixing operators. Even if you know the rules, brackets make a calculation less prone to misunderstanding.

    +1

  • RE: Group By MDX for YTD

    Hi,

    Try something like this

    With Member [Period].[Total] as ( [Period].[Jun] + [Period].[Jul])

    SELECT CROSSJOIN( { [Fiscal_Year].[2014] },

    { [Period].[Total] },

    { ADDCALCULATEDMEMBERS([Function].[All Function].Children) })

    ON 0 ,

    NON EMPTY CROSSJOIN( { [Fund].[10]}, { [Account_Code].[ABCD] })...

  • RE: STR

    Mike Dougherty-384281 (10/7/2013)


    '8E10' is a string literal, not a float_expression

    Even with implicit casting I'd have expected to get a numeric value of eight (8) but that expectation might come from...

  • RE: SQL JOINS

    Koen Verbeeck (1/8/2013)


    Not sure what this question tries to teach us.

    I spend 5 minutes looking for a mistake, only to finally decide there wasn't one, all joins seemed legit. I...

  • RE: Cross Apply to get child parent value from Xml in SQL Server

    Hi,

    I was just paling around with the query and got this:

    declare @x xml

    set @x =

    '<root>

    <row value="US">

    <col value="00">Jon</col>

    <col value="01">David</col>

    <col value="02">Mike</col>

    <col value="03">Nil</col>

    </row>

    <row value="Canada">

    <col value="C1">Pollard</col>

    </row>

    <row value="Japan">

    <col value="J1">Yin</col>

    <col value="J2">Li</col>

    </row>

    <row value="India">

    <col value="MP">Ram</col>

    <col value="UP">Paresh</col>

    <col value="AP">Mohan</col>

    </row>

    </root>'

    select v.value('../@value','varchar(100)'),...

  • RE: Why does my yesterday query return no results?

    Hi

    Did you try DATEDIFF(day, Docket_EngFinish , getdate())=1 ?

    The datediff by day checks only the day part and not the time.

    http://msdn.microsoft.com/en-us/library/ms189794.aspx

  • RE: Cast in Varchar with different options

    honza.mf (7/16/2012)


    Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.

    +1

    I copied the strings to...

  • RE: Ambiguous Column name'MedianCo' pleas help me

    Thanks Gail,

    I knew that there must be some reason for the longer version.

  • RE: Ambiguous Column name'MedianCo' pleas help me

    Hi Gail,

    I wonder if there is a difference between your update query and this:

    update TblGas

    set TblGas.MedianCo= t.MedianCo

    FROM Total AS t

    where TblGas.ID_NO= t.ID_No

    when I compeer the Execution Plans they look...

  • RE: T SQL

    rhythmk (7/9/2012)


    I got the answer in first click but then I thought what if SQL 2012 get WHERE clause in TRUNCATE command :hehe:

    +1

  • RE: Date Conversions

    Nice and easy one for me as i'm using it on a daily base cause this is my date format, but miss clicked and got it wrong :blush:

  • RE: Need help getting first value in a column

    Hi,

    I combined the 2 codes you supplied and got this

    create table #temp

    (

    ID nvarchar(20),

    SubID smallint,

    lOC NVARCHAR(3),

    Complete tinyint,

    Oper_num int

    )

    insert #temp (ID, SubID, LOC, Complete, Oper_num)

    values

    ('J000000001', 0000, 'W10', 1, 3),

    ('J000000001', 0000, 'W10',...

  • RE: Creating a comma-separated list (SQL Spackle)

    Hi,

    first of all grate article.

    I just used the (./text())[1] modification and got results with length over 70K chars!

    Kupy

  • RE: convert Row to column.

    Hi,

    I'm happy that I can help.

    The row number help with cause we have a new column to group by. If you'll add the rnum to the outer select you'll see...

Viewing 15 posts - 1 through 15 (of 33 total)