Reputation: 388
I have a column in the database that looks like this:
2015-10-22 11:26:19.3157376
SSRS automatically converts it to this:
10/22/2015 11:26:29 AM
I want the report just to show how it is entered in the database without formatting it. I know I can get this by doing:
=Format(Fields!creationdt.Value, "yyyy-MM-dd hh:mm:ss.fffffff")
Is there any way to just output the raw text from the DB without using format function?
I appreciate any help on this.
Upvotes: 0
Views: 106
Reputation: 1671
Well, it's interesting to say that the field in the database "looks like this", if it is a datetime datatype, because the text you see in the results of a query is just one representation of the actual stored data. The datetime datatype is stored in a special way that you'd never see just by querying. That data then gets represented as text in a variety of ways.
One thing you can do is to cast the datetime to a string data type in your query, which will make it display exactly in SSRS. However, you run into much the same issue on the sql side of things - the convert function to take the datetime value and put it into a string value allows the user to specify what format to display the date in, which is essentially the same thing you're doing with the Format function in SSRS.
Upvotes: 3