cancel
Showing results for 
Search instead for 
Did you mean: 

Dateadd function equivalent in BO

former_member539471
Participant
0 Kudos

Hello All,

I want to create few Filter objects in Universe. I have the logic in SQL sever DateAdd function. Is there any such equivalent function in Business Objects that I can use ?

Universe filter 1: Reporting Period

dbo.RPT_YEAR_MONTH=@Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained)

input value : 201406

Universe Filter 2: promptDateMinusThreeMonths

dbo.RPT_YEAR_MONTH= dateadd(month, -3, [promptDate])  ie   Dateadd(month, -3, @Reporting Period).

Thanks All.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pali,

In order to get previous date we can use RelativeDate() function as follows:

= RelativeDate([date_object];-90)

Above formula will give you dates prior to three months.

NOTE: This function is available in WebIntelligence and not in Designer. You can try achieving it at report level.

Regards,

Yuvraj

former_member190895
Active Participant
0 Kudos

Please do minus 3 in the  value list 'Folder\MeasurePractice\Rpt Year Month' as highlighted in bold. Let me know if its not working.

dbo.RPT_YEAR_MONTH=@Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month'-3,Mono,Constrained)

former_member4998
Active Contributor
0 Kudos

Hi

Try below Function: decrementDays

decrementDays(Date:DateTime,Number of days:Numeric)

Ex: decrementDays(@Select(DATE object),90)

Answers (1)

Answers (1)

former_member190895
Active Participant
0 Kudos

Try to use minus operator. Let me know if that is not working.

former_member539471
Participant
0 Kudos

Mantu,

I used minus operator....but since its an integer its not converting.I have sql logic for this

select

convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(rpt_year_month as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(rpt_year_month as varchar), 1,4))), 112) as preQuarter

from vMH_MEASURE_PRACTICE

where rpt_year_month = 201406


how do i use this conversion in the @prompt...


dbo.RPT_YEAR_MONTH=@Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained)