Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Datetime Value

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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