ProfK
ProfK

Reputation: 51063

How do I remove the time from a formatted DateTime in Crystal Reports?

I have a date field (based on DateTime in .NET) in Crystal Reports. I go through a complex format dialog, set the day to be 0n, the month to me 0n, and the year to be None, desiring a date representation of dd/MM. What I get is dd/MM hh:mm:ssAM.

What do I have to do to get rid of the time portion? It is overwriting other columns in the report making it unreadable?

I am using SQL Server 2012 Enterprise.

Upvotes: 1

Views: 28253

Answers (4)

Abdisamad Khalif
Abdisamad Khalif

Reputation: 825

Make sure that your Crystal Reports Details section previews your datetime column as a 'string' when focus on it, if so, go back to your table structure, and change your table's column datatype to smalldatetime, then in Crystal Reports, Right Click on Database Field in the File Explorer, then Click on Verify Database, then Ok, after verification of your database data to up to date, Right Click on you desired column and choice Format Object, now, Format Editor Window should appear, then select the Format you earned.

Source: My Experience

Upvotes: 0

craig
craig

Reputation: 26262

Right click the field and select "Format Field...":

enter image description here

Click "Customize...":

enter image description here

Select "Date" from the "Order:" picklist.

Select the "Date" tab:

enter image description here

Set a 2-digit month, a 2-digit day, and 'None' for the year.

Upvotes: 4

Waqar
Waqar

Reputation: 226

Call the field to a formula field. write a formula like this

todate(field_name)

now drag the formula field and format it, there will be no time there!.

Upvotes: 0

Siva
Siva

Reputation: 9101

Use formula

date(datetime field)

Upvotes: 4

Related Questions