SSRS Espression for String to Date Time format - reporting-services

Hi I have a SQL Stored Procedure to for my SSRS Report.
Below is the query to fetch Date i used.
(CONVERT(CHAR(10), ENTER_DT, 103), '''')
I am not in a position to change this query. The Dat Format currently displayed is "DD/MM/YYYY".
I want to display the date format as Below using SSRS Expressions.
MM-DD-YYYY
Please guide me to do that using SSRS Expresions. PLease help.

Just change the Display Format instead of converting into TSQL (Stored Procedure), Follow the steps go to textBox Properties, Select Number & Category Custom then Custom Format whatever you want

Related

Converting mdx parameter to ssrs between dates

I have several section of similar MDX code that has been created in Microsoft SQl Server Management Studio using cube data and I now need to use the code in a SSRS paginated report. I'm getting the following error:
"Query (4, 2) The restrictions imposed by the CONSTRAINED flag in the
STRTOMEMBER function were violated."
This code works fine in Management Studio and SSRS using a date but as soon as I change the date to a parameter I get the error.
MEMBER [Measures].[Sales in Period2] AS
AGGREGATE (
{STRTOMEMBER("[Paid Date].[Date].&[2020-11-01]", CONSTRAINED) : STRTOMEMBER("
[Paid Date].[Date].&[2020-11-30]", CONSTRAINED) }
, [Measures].[Paid Amount]
),FORMAT_STRING = "#.00;(#.00);0;0"
I've tried changing:
[2020-11-01] to [#StartDate1],
[2020-11-01] to [" + #ParameterName + "],
STRTOMEMBER to STRTOSET, and
remove CONSTRAINED.
One possibly way to approach this:
This error says that your #ParameterName is not in the correct format. In your example you have the date as 2020-11-30, i.e., yyyy-MM-dd format. So, your parameter should also have the same format. If the format is same you can use it &[#ParameterName] in your StrToMember.
To achieve this, you can change the Dataset of your parameter to format it in the required format.
Since you are using MDX to get the data, you can look at the option of getting the parameter values directly from your main data set or the date dimension, Paid Date in your example.
In my sample below using the AdventureWorks sample, you can see the date format is different. You may want to show the date format in a different format to the users, but internally you would want it in the same format as your Cube wants it.
I would suggest you look at this link as well to see an example end to end flow with MDX parameters:
https://blog.pragmaticworks.com/writing-parametrized-mdx-for-reporting-services
Good luck

SSRS and a stuborn Excel Serial Date

Sorry Guys, I need some help doing this for a datefield in SSRS. I have a spreadsheet that I export as an xml file, then use that xml as a datasource for my dataset in SSRS. The field for the date comes through as 42969 instead of a Date 22/08/2017. I am not sure how to convert this in ssrs to a date using an expression. Does anyone have an idea?
You can convert this quiet simply but as the data has come from Excel you need to adjust the date by 2 (Excel and SSRS/VB.NET treat serial dates differently).
The following should work
=DateAdd("d", Fields!MyDateField.Value -2, "1900-01-01")

VB Script ReportBuilder 3.0 Convert String Date to YYYY-MM-DD format

I am creating a cube report using Report Builder but I need to convert the date string so it can sort properly.
Currently the date appears like this "Fri, Apr 13th, 2012" and I need it too look like 2012-04-13 so that it will sort properly.
Can I do both the string formatting and sorting under the Tablix Properties - Sort ?
You don't have to sort by the same format that is displayed in the report. You can either do the sorting in the SQL beforehand or you can sort at the dataset, table, or group level in the report. If the column is a date datatype, you can simply sort by it. As far as the formatting is concerned, if you right-click on the textbox and go to properties, you will see the date formatting options.

Hashed field not displaying in SSRS

I have a query that is using this convert function that correctly displays the data when I preview it in the SSRS Dataset:
CONVERT(varchar(255), HashedFileNum, 1) AS HashedFileNum
returns values like
0x7BB9D2F1A8A1B39832B95B932DD73A31
However when I try to add that field to my report I get #ERROR in the field instead of the value.
Any suggestions on getting the value to show in my report?
Try converting to nvarchar instead of varchar; I've had a similar issues in the past.

what is correct format to pass Today as work item createdDate parameter

I have created data set (as TFS drill through report) using TFSOlap data source which is displaying all bugs based on created date. Now, I want to pass date range as parameter from main report so drill through report displays data for the bugs created between given date range. I am getting error "string.. can not be converted to date type" I am using following formatting expression at drillthrough report parameter:
="[Work Item].[System_CreatedDate].&[" + FORMAT(Parameters!FromWorkItemSystemCreatedDate, "yyyy-MM-dd") + "T00:00:00]"
Please let me know what type of expression should be used to avoid error. I tried with using CDate() instead of FORMAT but still getting problem.