Skip to Content
avatar image
Former Member

creating formula for parameter

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 29, 2008 at 09:27 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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