Tuesday, February 14, 2012

Corrupted FormatDateTime Results

Using SQL Server 2005 Developer Edition and reporting services.

My report pulls a datetime field from the database, for example holding a value of 9/9/2006 12:00:00. It places this field by itself in a textbox.

I want it to display as long date (Saturday, September 09, 2006) so I set the format of the textbox to:

=FormatDateTime(Fields!Contest_Dt.Value , 1 )

This displays the results quite oddly as:

SaAur9a6, SepAe0ber 09, 2006.

Any ideas as to what is going on here and how to fix it?

Thanks in advance!

When I try this, it works as expected. Are you sure the value in the database is stored as a datetime value not as a string?

Can you also try this expression: =FormatDateTime(CDate(Fields!Contest_Dt.Value, 1))

-- Robert

No comments:

Post a Comment