Rank: Member
Groups: Registered
Joined: 6/9/2017(UTC) Posts: 29 Thanks: 1 times
|
I have a data source defined with the following parameters:
Database Type: MS SQL Server Date Time format: MM/dd/yyyy
Date fields in the Server Manager are defined with the 'Date & Time' data type.
In the Web Report Designer, I created a report with a date field, the 'Short date' format has been specified for that field.
When I generate the report, the dates come out in this format: 2018-01-24 05:00:00.000000
I cant't find a way to get the date in the format I specified (MM/dd/yyyy), and the time is alway included even if I asked for a short date.
Do you have any suggestions as to what I'm missing?
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Well, in the Report Designer: Default -> take the format specifed in the configuration (Server Manager -> Configuration -> Configure Server...) Then you have pre-defined format you can use Then you have Custom that allows you to specify the format you want like MM/dd/yy H:mm:ss zzz You can have a look at the standard date time patterns (pre-defined): https://docs.microsoft.c...-and-time-format-stringsOr custom patterns: https://docs.microsoft.c...-and-time-format-stringsI am surprised that the report comes out always with 2018-01-24 05:00:00.000000, are you sure that the SQL column you query is a real date time ?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/9/2017(UTC) Posts: 29 Thanks: 1 times
|
The date field I used for my test is defined as datetime2 data type. The report is in fact reporting the date in the format of that data type regardless of the format I apply to it in the report designer.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Yes, that is probably the problem, I will check the datetime2 for SQL Server and make the fix for future releases.... in your column definition can you convert it to normal datetime: convert(datteime, colName), this should solve the problem.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.