cancel
Showing results for 
Search instead for 
Did you mean: 

creating formula for parameter

Former Member
0 Kudos

hi

i have a date field as my parameter and i need to convert it to week no and year so i created two parameters WeekNo and YearNo then i created two formulas {vw_wrkWorkOrders.CompleteByDate} = CStr(datepart("ww",{?WeekNo}),0) and {vw_wrkWorkOrders.CompleteByDate} = CStr(datepart("yyyy",{?YearNo}),0) but it's still not showing as weeks and year, the full date is displayed,

how do i do this.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

In both the formulas, remove the database field part and write them as below:

CStr(datepart("ww",{?WeekNo}),0)

For extracting just the Year, use the Year() function,

Now drag the formula fields on to the report and see the preview.

Hope this helps!!!!

Regards

Sourashree

Former Member
0 Kudos

thanks Sourashree for a quick response and yes your formula works when displaying these values in the report but what i also need to do is display the parameter values in the dropdown as week no. and year no.

Former Member
0 Kudos

Hi

Only databse field values are included in the parameter, hence if the data type of a field in Date time in the database,it's not possible to extract only the year part of it and show it in the drop down of the parameter.

However, you can write a formula for extracting the year and apply a record selection based on that.

Hope this helps!!!

Regards

Sourashree