Solved

Datetime Value

Posted on 2004-03-24
7
893 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 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