January 14, 2014 at 4:12 pm
I don't know why I'm having such a problem with this.
I have a dataset that is returning a date in the correct format that I want: M/d/yyyy. However, when I preview the report with the data in a table, it keeps displaying it as MM/dd/yyyy.
I've tried setting the Format property of the text field to M/d/yyyy, (no change) and I've tried setting the expression for that field to =Format(Fields!TripDate.Value,"M/d/yyyy") but just see the actual values M/d/yyyy in the field.
What am I doing wrong? I've been scouring the internet searching for some format option that just drops the leading zeros on the date and nothing suggested works.
I am slowly going insane, so any help would be very, VERY much appreciated.
January 14, 2014 at 4:31 pm
tacy.highland (1/14/2014)
I have a dataset that is [highlight="#ffff11"]returning a date in the correct format[/highlight] that I want: M/d/yyyy. However, when I preview the report with the data in a table, it keeps displaying it as MM/dd/yyyy.
From your description, it sounds a lot like you are not selecting a column with a "DATE" datatype from the database (as they are not "Formatted"), so are you perhaps formatting it in the SQL SELECT?
The fact that your Format() expression is not working also suggests that the data is actually a string.
It is best to NOT format dates in the SQL query and just use the "format" property of the textbox displaying the data - the format string you have is correct M/d/yyyy and should work on an actual Date column.
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
January 14, 2014 at 5:06 pm
Thank you so much.
I went back into the Select statement and cast the Tripdate value as smalldatetime and refreshed the fields in the Dataset. That finally did the trick.
Thank you, for giving me sanity again.
😉
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply