Jump to content

Annemie19

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Annemie19

  1. Hi There, 

    I have the following table that I created from the below query

    image.thumb.png.620fda4cb305f34b060fe5585f7efd54.png

     

    SELECT
    d.DealID, 
    d.DealNumber, 
    d.NominalAmount, 
    --i.StartDate,
    DATEADD(day, -1, i.EndDate) AS [AdjustedEndDate], 
    i.Rate, 
    cp.ProjStartDate, 
    cp.ProjEndDate, 
    dir.InterestMultiplier 

    from [dbo].[VwPrefSharesDeal] d
    JOIN VwPrefSharesCashProjection cp on cp.DealHashKey = d.DealHashKey
    JOIN [dbo].[VwPrefSharesDealInterBankRelation] dir ON d.DealHashKey = dir.DealHashKey
    JOIN [dbo].[VwPrefSharesBank] b ON dir.InterestBankHashKey = b.BankHashKey
    JOIN [dbo].[VwPrefSharesInterest] i ON b.BankHashKey = i.BankHashKey

    WHERE DealID = 'SI001263-03'
    and ProjStartDate = '2020-03-31 23:59:59.0000000'
    ORDER BY i.StartDate

     

    I want to show the start date as the ProjStartDate = '2020-03-31 23:59:59.0000000' when the ProjStart date is after the startdate and the AdjustedEndDate as and ProjEndDate = '2020-09-30 23:59:59.0000000'. 

    For instance, I only want to see the following dates

    image.png.1049bfac6d61423f10261687f06be285.png

     

    I have tried Case When, but I cannot get it to work. 

×
×
  • Create New...