Answered by:
Report Design (rdlc) - how to format a date string

Question
-
User-939424565 posted
I am in Report Design. I have a textbox that is reading a DateTime field from SQL 2005 database. The textbox has the following expression when I first put it on to the Report Designer: =First(Fields!BatchCreateDate.Value, "BatchDAL_Batch_Table").
The output on the webform looks like this: 1/18/2009 3:51:00 PM
What I want is for it to look like this: Jan 18, 2009
Where do I format the expression? I tried putting this in the Format Property: =DateString("MMM dd, yyyy) but this did not change anything.
Saturday, January 24, 2009 2:48 PM
Answers
-
User1674611532 posted
In your case use:
MMM dd, yyyy
Javier
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, January 24, 2009 4:23 PM
All replies
-
User1674611532 posted
In the report (rdlc) ,
Right Click in the Field, select properties,
Select the Tab Format, and use the format code you need.d
Short date
D
Long date
t
Short time
T
Long time
f
Full date/time (short time)
F
Full date/time (long time)
g
General date/time (short time)
G
General date/time (long time)
Javier
Please do not forget to mak it Answer it.
Saturday, January 24, 2009 4:04 PM -
User1674611532 posted
In your case use:
MMM dd, yyyy
Javier
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, January 24, 2009 4:23 PM -
User119618378 posted
Thanks javier it really works well.
i have used the following for showing date and time in 24 hours format:-
dd-MM-yy HH:mm
Wednesday, February 18, 2009 3:29 AM -
User-2111753889 posted
Thanks a lot for the information
Thursday, August 20, 2009 5:52 AM -
User1163656830 posted
Dear,
Try Following:
In the expression window of Text Box:
=Cdate(First(Fields!BatchCreateDate.Value, "BatchDAL_Batch_Table").Month) & " " & Cdate(First(Fields!BatchCreateDate.Value, "BatchDAL_Batch_Table").Day) & "," & Cdate(First(Fields!BatchCreateDate.Value, "BatchDAL_Batch_Table").Year)
This will work/././.
Tuesday, August 17, 2010 3:19 AM -
User827344553 posted
Thank you very much for this information, it just solved my challenge.
Happy New Year everyone in this forum
Tuesday, January 25, 2011 9:48 AM -
User1505188413 posted
Hi.
I just have run in same problem,
and solution i like is :
=CDate(First(Fields!DateFrom.Value, "dataReport")).ToString("dd.MM.yyyy")
Point is, when you convert to date with CDate, you have DateTime instance where you can perform formation as you wish.
Something similar is for decimal, double.... etc.
Friday, January 28, 2011 8:54 AM -
User-1089808927 posted
It work in Local succes
but it work in server
Tuesday, September 13, 2011 1:43 AM