Yanıt Report Expression Help

  • Thursday, January 17, 2013 8:40 PM
     
      Has Code
    I have 2 cognos report expressions i need them to be converted into an SSRS exppression... Has someone done it ..?
    
    first -of-month (datetime-to-date(make-datetime(?Year?,?BePeriod?,1)))....
    
    last-of-month (datetime-to-date(make-datetime(?year?,?EndPeriod?,1)))...
    
    
    
     "Activity from: January 1, 2011 thru Period Ending January 31, 2011 " This is the Intended output i am trying to get into my SSRS report header
    
    I have 3 report parameters
    
    Year
    BegPeriod
    EndPeriod
    
    
    
    Thank you

    FM

All Replies

  • Thursday, January 17, 2013 9:10 PM
     
     Answered

    Try this.

    First Day of Previous Month)
    =dateadd(dateinterval.month, -1, today().AddDays(-(today().Day-1)))

    =DateSerial(iif( Month(DateTime.Now)=1, Year(DateTime.Now)-1, Year(DateTime.Now)), iif( Month(DateTime.Now)=1, 12, Month(DateTime.Now) - 1), 1)

    =DateSerial(Year(Now()), Month(Now()), "1").AddMonths(1).AddDays(-1)

    Current month

    =DateSerial(Year(Parameters!ParameterName.Value), Month(Parameters!ParameterName.Value), "

    --previous month last
    =DateSerial(Year(Now()), Month(Now()), "1").AddDays(-1)

    --previous month first
    =DateSerial(Year(Now()), Month(Now()), "1").AddMonths(-1)