cleverpaul
cleverpaul

Reputation: 935

SSRS - How can I set the format for the date/time parameter to yyyy-mm-dd hh:mm:ss?

I have a report in SSRS that requires data to be shown between a data range. One of my datasets works perfectly inside the query designer, but when I run the report, the data returned is blank.

I figured out that this is due to the SSRS date time looking like this:

'14/01/2019 10:33:59 AM'

My SQL stored procedure that I am using for my dataset requires the following format:

2019-01-14 10:33:59

How can I make SSRS comply with the format requirement?

Upvotes: 1

Views: 3472

Answers (1)

Strawberryshrub
Strawberryshrub

Reputation: 3399

You need to set under report properties, localization your language to a value (this property can´t be empty), then you can add the following expression for your desired output:

=Format(CDate("14/01/2019 10:33:59 AM"), "yyyy-MM-dd HH:mm:ss")

'Result
->2019-01-14 10:33:59

Upvotes: 1

Related Questions