SSRS 2008 R2- Format Parameter to DD/MM/YYYY - sharepoint

I have SSRS 2008 R2 and am working on reports for the UK.
My report has a Date/Time data type parameter. When user opens the report the default date format is MM/DD/YYYY, but I would like to have DD/MM/YYYY format (same if user pick date from Calender drop-down date selection).
I have changed the Language settings on the reports to UK and it formats the dates within the dataset, not the parameter. I have also tried using a cdate expression but that does not work either.
One work around is just changing it to nvarchar in my SQL code however, I have a few scripts that use a > #eomdate so the nvarchar will not work in that case.
Any ideas?

Please see this post on the MSDN forums. The calendar drop down and the date format of the parameter's text box are dependent on the user's Language settings in their browser, not on the report.
If you want to force users to have the same displayed dates, you'll have to use a text field formatted as you want and then use CDate() in your code to turn that varchar into a date for performing time comparisons.

This is what I did to resolve the issue in the SQL Code to get it to work in SSRS as a hack.
declare #eomdate varchar(50)
set #eomdate = '31/01/2013'
select * from policiesEOM p
where p.eomdate >= convert(datetime, #eomdate, 105)
Then I changed the datatype to Text and it works perfectly.

The ssrs date type use the browser language in Google Chrome, Mozilla Firefox, Opera and Safari. In Edge too. IE use the windows regional date format.
If you don't want to use date drop box, you can use a text parameter and convert the value to date with ssrs built in convertion function.

Related

Export Salesforce dates in a way that Excel Mac can use

I am exporting reports as XLS files from Salesforce. These reports have dates that I want to be able to manipulate in Excel but... Excel doesn't recognize them as dates.
The format outputted by Salesforce right now is m/d/yyyy (ie: 8/18/2022). When I go in Excel and change the format to date... the data is not recognized as a date.
It seems the only thing that Excel can consume are dates configured as yyyy-mm-dd.
I tried to play with Excel formatting date form with no luck.Excel doesn't recognize the Salesforce format, or does not propose anything similar to it
Is there a setting in Salesforce or in Excel that I need to adjust so that both apps can generate, and digest the same date configs?
I want to run these reports weekly so whatever requires the less Excel gymnastic will be the best solution (Google Docs for instance recognize dates as Salesforce spits them... - but I can't use GDocs at work).
You should use PowerQuery to import the data to Excel.
In PowerQuery change the Column-Type USING LOCAL
Select Date and English (United States)
Voila!

Converting text to data Apr 06, 2020 in excel

I need help in converting this text value exported in text format from software management tool "Apr 06, 2020" to data format.
I have tried various methods like text to columns then picked all of the possible data formats but nothing works. Can you please help or suggest any solution?
Your problem is a mismatch between your Windows Regional Settings (which Excel relies on in order to parse your date), and the date format in the exported file (which appears to be US-English).
You have several choices:
If the file exported from your management tool is a text or csv file, you can probably use Power Query to import the file. Select Transform then right click on the Date column and select Change type => Using Locale => and select Date and English-US.
You could change your regional settings to English(united states) while you do the import, then change them back.
If none of the dates get converted, you could try this formula:
=DATE(RIGHT(A1,4),MATCH(LEFT(A1,3),{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"},0), MID(A1,5,2))
Note that in the formula, you may need to change the commas to semicolons, or whatever your country uses to separate formula arguments
You can use below formula, Where A1 is date cell
=DATEVALUE(MID(A1,5,2)&"-"&LEFT(A1,3)&"-"&RIGHT(A1,4))

SSRS TimeStamp incorrect format when exported to Excel

I have a datetimestamp field in SSRS, when I preview the report the data looks okay (2015-06-23 1:33:00 PM), but when I export the report to excel it creates ############### and not showing the date time. The dataset is done in SQL query cast(m.CallTime as datetime). What I want to happen is to display just the time in SSRS and Excel (1:30 PM). Thanks.
I've always had issues with the Excel export with date formats but I think that's more due to Excel propensity to guess wrong at the format I want. Why is it whenever I have a date with no time, it usually is formatted as time only (0:00)? Very annoying.
Make sure that your date is in a date format. You casted it in your query but you could also use CDATE to do it in SSRS.
Set the format using the Textbox's FORMAT Property to hh:mm tt .
It should come out as specified in Excel.

SSRS date format in Excel with localization

I'm trying to export a SQL Server 2008 R2 Reporting Services report to Excel. The report has a column of dates. The date is stored as a datetime in the SQL server.
The language of the report is set to =User!Language, the format of the date-cell is d.
When exporting/rendering the report to PDF, everything is displayed in the locale of the request made by the browser (Accept-Language).
When rendering to Excel however, the format suddenly changes, for example, to General ([$-10409]M.T.JJJJ) (German Excel, locale of the OS set to de-AT, browser-locale is en-US).
This means that the Excel displays dates in a completely wrong format - the sequence of day, month and year is hardcoded and only the separator comes from the current locale. This makes sharing reports between different OS languages almost impossible since a report generated from a d-m-yyyy country will still display as day-month-year in a country with different date formatting (and vice versa). So any person expecting a m/d/yyyy formatted date will get d/m/yyyy.
This is especially dangerous if there are no dates with days above 12 - ie: it is very likely to misread the displayed date because there is no obvious error.
When manually setting the cell-format in Excel to date, everything seems fine and the format changes with the locale of the OS.
Is there any possibility to force the cell to be formatted as Date in Excel without having to edit the Excel file itself?
P.S: numbers are also not formatted as a number but as [$-10409]#.##0,00;-#.##0,00 - which is less of an issue but still potentially a source of errors. (format in the report is N2)
I've manages to solve similiar issue. Solution is rather simple.
In report editor, open Design view and select field, which you want to edit, right mouse click and choosee either Expression or Textbox properties. The rest is very intuitive as in Excel editor.

SSRS 2008 Excel Currency Cell Format

I'm using SSRS 2008 and I have a financial report. I would like the dollar amounts in my table to be in currency or number format when exported to Excel. Currently they end up being text.
I have trying a few things to see if its even possible. I removed the table header, didn't use the $ sign, and converted the field to decimal, but nothing seemed to work. The data in Excel always seems to be format as text.
Any suggestions?
Make sure you are using the Format string "C" but the export to excel is really a text rendering - it does not hold Excel specific attributes/qualities.
I found that instead of using a format function in the expression like:
=Format(myvar.value, "C")
Its better to not to use an expression and just change the Text Box Properties on that field. For example, I'd leave the field as:
=myvar.value
Then I would right click on the field, go to Text Box Properties, Number Sub Category/Tab, and select currency.
When doing this the results in Excel are a custom number format vs a text format.

Resources