Click here to Skip to main content
15,905,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Form that has a DatePicker type field on it where the user enters the date. The date is then stored in an Access database table. The field in the table is formatted as a short date.

The problem is that when I create a report based on the input from the form, the date and time appears. I want to have just the date to appear in my report without the time element.

How do I extract just the date portion for my report? I believe I need a function to accomplish this. What would the function be, and where do I put the function so that the date in the report excludes the time element?
Posted

Thanks for the response. I have read the article that you referenced in your answer to my original post, and I have created the below function to convert a long date to a short date.

But, how do I get the dates to appear in my report as a short date (date only no time portion)? I need each date for each record in the database that appears on the report to appear as a short date in the "mm/dd/yyyy" format. How do I use the below function to convert the dates so they don't have the time portion? There must be something simple that I am overlooking.

Any help in this matter will be greatly appreciated.

VB
Public Function DateShort(ByVal Mydate As Date) As String
       Mydate = Mydate.ToString("d")
       Return Mydate
   End Function
 
Share this answer
 
(I am the original poster of this thread.) I realize now that to get the dates to appear in my report in the short date format (mm/dd/yyyy), all I have to do is right-click the date field in the Report.rdlc design screen and select Placeholder Properties... and then select Number and then select Date, and finally select the date format I want.

After doing all of that, the dates in my report will no longer display the long date and time format, but will display the short date format without the time.

I hope this might help some other newbie that comes up with the same issue.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900