Forum Replies Created

Viewing 15 posts - 256 through 270 (of 926 total)

  • RE: Head()

    good question. thanks for sharing

  • RE: Percentile Calculation

    Can you give more detail regarding you actual scenario, like table structure, some sample data and your desired output to better understand your problem?

  • RE: String to Date without time-Sql server 2012

    Use Try_Convert instead because it will not give you any error of type casting.

    Below will give you understanding

    Declare @T table ( stringDate varchar(20))

    insert into @T

    select '2-12-2012' union all

    select '11-12-2015' union...

  • RE: SSAS: Add Calculated Measure as child measure

    When you say Measure S you mean Sum of Measure A + Measure B?

    if so then just your Measure A + Measure B you will get your desired result.

    And...

  • RE: SSAS: Add Calculated Measure as child measure

    What do you exactly mean saying Parent Measure? can you share any example/detail and desired output ?

  • RE: Merge statement

    Thanks for sharing some details.

    Few suggestions

    1. It would be better you include FingerTable Foreign Key into you counter table as this will help you identify exactly which Counter belongs...

  • RE: Move database log files massively

    Check this Moving User Databases

    hope it helps

  • RE: DATEPART to calculate financial year

    faulknerwilliam2 (9/15/2015)


    Hello

    I have a report that uses the Datepart function to return the current, and previous, year's data:

    DATEPART(YEAR, a.Date);

    DATEPART(YEAR, a.Date) = DATPART(YEAR, GetDate())-1

    This brings through calendar year fine.

    Is it possible...

  • RE: DATEPART to calculate financial year

    pietlinden, finanacial year start from April and end on March of the next year,

    your query will not calculate properl FY

    please check this

    declare @OrderDate datetime = '2000-04-01'

    select

    DATEPART(QUARTER,@OrderDate) AS...

  • RE: Query Optimization/Cleanup

    i agree with Eirikur suggestions.

    when you say

    john_rowles (9/14/2015)


    Basically, there should only be one row per month-year. I want to know the pointsEarned/maxPoints for a given calendar month.

    'CharacterName' column...

  • RE: Merge statement

    some of my rows have to be send to another system (which is not in my control) and I have to provide the key for it, that is why I...

  • RE: Difference count

    ramrajan (9/4/2015)


    declare @startdate datetime = '2015-03-31 23:59:59.097';

    declare @enddate datetime = '2015-04-01 00:00:00.000';

    returns 2

    Awesome simplified solution with SELECT DATEDIFF(Year, @startdate, @enddate) + 1 AS QUARTER_DIFFERENCE

    Correction Year should be replaceed...

  • RE: Difference count

    You can avoid most of this by simply creating a Calendar Table in your database. you query will become a lot simpler.

    Why i used sys.all_columns (Btw well you can use...

  • RE: Difference count

    I thought you might have figure it out but my bad, here is the complete version

    declare @enddate datetime = cast('2015-09-03 00:39:53.973' as date)

    declare @startdate datetime = cast('2014-11-07 00:42:39.920' as date)

    SELECT...

  • RE: Difference count

    It is best if you can have calendar table in your database. will help you a lot in these kind of queries.

    However, you can do something like this as well

    declare...

Viewing 15 posts - 256 through 270 (of 926 total)