Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format DateTime Fractional Seconds

Status
Not open for further replies.

mklikes

Programmer
Dec 2, 2003
3
US
I am using Crystal Reports 9 and a thirdy party ODBC Datasource.

This datasource has a datetime field that has time precision to 1/1000 of a second (displayed as mm/dd/yy hh:mm:ss.sss). When I bring this data into Crystal, it rounds to the nearest second (mm/dd/yy hh:mm:ss). For my reporting I need all of the resolution for the time. How can I display subseconds in Crystal?
 
Didn't I answer this yesterday?

Create a SQL Expression using DATEPART or the equivalent in the native database SQL if pssible.

If not, consider posting technical information, such as the database used, example data and expected output.

Your posts states that you want all of the resolution, and then states that you want only the milliseconds, please demonstrate the desired output.

-k
 
The native database is based on Objectivity (an object oriented database), as a result I can only read the data. Therefore I must do any transforming of the data in Crystal. As stated the native format is 'mm/dd/yy hh:mm:ss.sss' and I am trying to keep it in this format within Crystal. Can this be done on Crystal Reorts 9?
 
mklikes,
sv, wasn't suggesting you change the DB, he suggested you adjust your Select statement/SQL/query/formula/whatever you're using by including a DatePart() function (which is a Crystal function) or using a function appropriate to your database.

HOWEVER, if you read the field in as a String instead of a DateTime, you should have the value in its entirety. Then you can parse it appropriately.

SV is right that specifics, make answering your question easier... If you don't understand what I've posted, and you are responding once again, please include a value from your time field, and the value as returned from the Crystal Date function you're using.

Thadeus
 
Here is the SELECT Statement from Crystal..

SELECT ProcessData.Value, Item.Name, ProcessData.EventTime
FROM dbo.Item Item, dbo.ProcessData ProcessData
WHERE Item.ID=ProcessData.ItemID AND Item.Name='FV.Pressure'

One of the EventTimes that I get back looks like this...
11/21/2003 7:19:04AM

I would like it to look more like this...
11/21/2003 7:19:04.213AM
or something simlilar that contains the precision on the time part.

I hope that this is specific enough. If not let me know what I am leaving out.

By the way, I believe the data is coming in as a datetime format as opposed to a string format.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top