Greetings,
I am trying to display two dates in a single text box, along with other text (e.g., Reporting from: 10/20/2011 11:00 AM to 10/20/2011 12:45 PM), based on fields returned from an SQL query. The date fields are returned as SQL DateTime types. When breaking down the DateTime field for minutes under 10 (using the sub options presented in the Fields display of Edit Expression), I am only getting one digit to display. Is there a way to force that to format to 2 digits, have the leading zero display? If I put just the datetime field in a text box then the Format {0:f} (or other choices) seems to work, but once it's a mixed hard-code text and field value the overall Formatting doesn't work, not recognizing the datetime part vs the rest of the text in the Edit Expression list. [The main purpose in breaking this all up is to avoid the Seconds being displayed.]
What's in my "Edit Expression" window is:
Reporting From: {Fields.StartDate.DayOfWeek} {Fields.StartDate.Month}/{Fields.StartDate.Day}/{Fields.StartDate.Year} {Fields.StartDate.Hour}:{Fields.StartDate.Minute} {Fields.StartDate.Kind} to ...
What I get is:
Reporting from: Thursday 10/11/2011 11:0 Unspecified to ...
Also, the Fields.StartDate.Kind comes back "Unspecified", is there a simple error I'm making there too? Was expecting AM or PM.
Regards
Dave Clements
I am trying to display two dates in a single text box, along with other text (e.g., Reporting from: 10/20/2011 11:00 AM to 10/20/2011 12:45 PM), based on fields returned from an SQL query. The date fields are returned as SQL DateTime types. When breaking down the DateTime field for minutes under 10 (using the sub options presented in the Fields display of Edit Expression), I am only getting one digit to display. Is there a way to force that to format to 2 digits, have the leading zero display? If I put just the datetime field in a text box then the Format {0:f} (or other choices) seems to work, but once it's a mixed hard-code text and field value the overall Formatting doesn't work, not recognizing the datetime part vs the rest of the text in the Edit Expression list. [The main purpose in breaking this all up is to avoid the Seconds being displayed.]
What's in my "Edit Expression" window is:
Reporting From: {Fields.StartDate.DayOfWeek} {Fields.StartDate.Month}/{Fields.StartDate.Day}/{Fields.StartDate.Year} {Fields.StartDate.Hour}:{Fields.StartDate.Minute} {Fields.StartDate.Kind} to ...
What I get is:
Reporting from: Thursday 10/11/2011 11:0 Unspecified to ...
Also, the Fields.StartDate.Kind comes back "Unspecified", is there a simple error I'm making there too? Was expecting AM or PM.
Regards
Dave Clements