Solved

Datetime Value

Posted on 2004-03-24
7
894 Views
Last Modified: 2012-05-04
Hi All,
I created a dynamic report by using crystal reports .NET (I have used formula fields).I am using VB.NET. But the problem is that, I don't want any leading zero in time values, I want only date value. For example in my MS-SQL DB, the field has 21.06.2003 value. When I get it with crystal report it takes 21.06.2003 00:00:00. I couldn't handle this by changing property of the fields.
How can I handle this? (Sorry for my English since it is not my native language,I hope my problem is clear)
Thanks in advance
0
Comment
Question by:boranico
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Accepted Solution

by:
Ken Turner earned 168 total points
ID: 10675343
I'm not familiar with Crystal Reports .NET, but in CR8.0 and CR9.0, you can resolve it as follows:

Place the field on yout report, then Right Click -> Format Field -> Date / Time Tab -> Customize -> Date/Time Tab -> Order dropdown -> Select Date -> OK -> OK.

Hope this helps ...
0
 

Author Comment

by:boranico
ID: 10675568
There is no Date/Time tab in Format Field.I think my Crystal Reports version is not 8.0 or 9.0.
I am using CR for .NET
0
 
LVL 28

Assisted Solution

by:bdreed35
bdreed35 earned 166 total points
ID: 10677288
In the field explorer, expand your database table that contains the field in question.
If you right click the table, and select show field data type.
This will tell you the datatype of the fields you are returning.
I suspect that it is returning a string datattype since there is no dat/time tab in the Format Editor.

I would try creating a formula to convert it to a date field.
In the formula, you can try something as simple as this first:

CDateTime({table.field});

If this doesn't work, you will replace the ".' with slashes like this:

CDateTime(Replace({table.date},".","/"));

In either example, replace {table.field} with your field.

Good Luck!
~Brian
0
 
LVL 4

Assisted Solution

by:stasau
stasau earned 166 total points
ID: 10677376
If this is the case then it is likely your database field is not a datetime field.  Crystal adds this tab to the Format screen if the field type is datetime.

Did your field change its datatype since you created the report.  You might want to try:

Verifying the Database
- Open your report in Visual Studio
- Right Click in the report in one of the sections
- Click on Database
- Click on Verify Database

Or, you can set the date format by

- Open your report in Visual Studio
- Right Click in the report in one of the sections
- Click on Designer
- Click on Default Settings...
- Click on the Fields tab in the window that opens
- Click on Date
- Set your format
0
 

Author Comment

by:boranico
ID: 10684954
Thanks everybody. I found the solution. In the report ,I right click and select Report/Report Options... From there I choose the format.
Thanks again.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question