Solved

Datetime Value

Posted on 2004-03-24
7
889 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
7 Comments
 
LVL 6

Accepted Solution

by:
Ken Turner earned 168 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now