?
Solved

Datetime Value

Posted on 2004-03-24
7
Medium Priority
?
896 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 672 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 664 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 664 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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. …
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

762 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