Forum Replies Created

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

  • RE: Show data based on MAX Action date - end of the month

    drew.allen - Tuesday, January 30, 2018 10:07 AM

    jaggy99 - Tuesday, January 30, 2018 12:17 AM

  • RE: Show data based on MAX Action date - end of the month

    Sean Pearce - Monday, January 29, 2018 11:38 PM

    You can simply use the ROW_NUMBER function in your CTE, like this:

    Declare...

  • RE: Show data based on MAX Action date - end of the month

    Thanks Sean that worked. What about the below approach?

    ;with dates(Month_End) as (select cast('2014-01-01' as datetime)-1 as datetime union all select DATEADD(month, 1, Month_End+1)-1

  • RE: Calculate Days between Teams

    drew.allen - Friday, January 12, 2018 1:54 PM

    Are you really on SQL 2008?  This is a lot easier on SQL 2012.

    Also, using...

  • RE: Create From and To dates

    Forgot to mention that im running SQL 2008 in production and LEAD function is not supported. Is there another way to achieve the same result?

    Thanks
    Jag

  • RE: Create From and To dates

    jaggy99 - Saturday, April 1, 2017 4:52 PM

    J Livingston SQL - Saturday, April 1, 2017 7:48 AM

  • RE: Create From and To dates

    J Livingston SQL - Saturday, April 1, 2017 7:48 AM

    possibly something along these lines...??

    ;WITH
        cte_FixData AS (
            SELECT
                r.R23_SQL_ID,
                r.PROP_CODE,
                r.TENANT_NUMB,
                From_Date = CAST(r.DATE_CHANGED_SQL...

  • RE: Vacancy Rate

    in that case wouldn't it be easier to do the vacancy rate calculation in Tableau/Excel as it will be easier to apply the forumla?

  • RE: Vacancy Rate

    Do we need to use Right outer Join as we are joining properties table with vacant table. Not all active properties are vacant.

    Jag

  • RE: Vacancy Rate

    Help then please. 🙂

  • RE: Vacancy Rate

    Hi,

    Can you check the vacany rate formula is correctly applied:

    DECLARE @vacant TABLE ([Prop Code] INT, [History Ind] INT, [Void Start Date] VARCHAR(23), [Accepted by Allocations] VARCHAR(23), [Let Date] VARCHAR(23), Team...

  • RE: Vacancy Rate

    Please find below the desired output

    https://app.box.com/s/eo6045eln5zwjm3jxs282ceefmh3w892

  • RE: Vacancy Rate

    I have joined the calendar table and vacant table but it returns a single row where it should return two rows one for Jan vacant days and Feb Vacant days....

  • RE: Vacancy Rate

    Sorry you are correct it should be 7.

  • RE: Vacancy Rate

    Ok, i got the below Month End Calendar Table. Whats next please

    ;with dates(Month_End) as

    (

    select cast('2013-02-01' as datetime)-1 as datetime

    union all

    select DATEADD(month, 1, Month_End+1)-1

    from dates

    where Month_End < GETDATE()

    )

    select * from...

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