This technical note lists the steps to display yesterday's date in a Report Services document in MicroStrategy Developer 9.x - 10.x
There is no out of the box auto text in Report Services documents to display yesterday's date in Strategy Developer 9.x - 10.x. The following procedure describes how to achieve this requirement with a workaround:
Create a metric "Yesterday" with expression "AddDays(CurrentDate(), -1.0)". Note: "CurrentDate()" and "AddDays(Date,n)" are Strategy built-in functions. "CurrentDate()" will be translated to appropriate syntax for different databases to retrieve current date. "AddDays(Date,n)" is used to return a date plus an offset (+ or -) n days.
Create a report with the metric "Yesterday".
Add the report created in step 2 as dataset report of the document which is required to display yesterday's date.
Add metric "Yesterday" to the document section as dynamic text.
Right click on the dynamic text and then click on "Format".
Select to display the text box in the required date format s shown in the image below:
Execute the document in PDF view, the dynamic text displays yesterday's date, as shown below: