Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: converting time Post Reply Post New Topic
Author Message
ricky969
Groupie
Groupie
Avatar

Joined: 03 Jul 2008
Location: United States
Online Status: Offline
Posts: 53
Quote ricky969 Replybullet Topic: converting time
     Posted: 13 Aug 2010 at 5:28am
the datatype in sql2008 is Time(7). CR9 reads the field returned by the proc as string[16] and returns 11:58:23.0000000
 
i need to convert it back to a time value for two main reasons:
- remove .0000000 (i can probably achieve that by using Time(0) in the stored proc)
- based on the user system settings i'd like to have the time displayed as 12H or 24H
 
the field can be NULL 
 
Thank you for your attention and help


Edited by ricky969 - 13 Aug 2010 at 5:34am
IP IP Logged
ricky969
Groupie
Groupie
Avatar

Joined: 03 Jul 2008
Location: United States
Online Status: Offline
Posts: 53
Quote ricky969 Replybullet Posted: 13 Aug 2010 at 6:05am
resolved the issue by:
 
setting Time(0) on the table holding the time so instead of getting back
11:50:55.0000000 i was getting 11:50:55 and then i used the function CTime(Database.time) to convert. it worked perfectly
 
note: if you cannot change the setting in the table, you can always cast in the proc. that works too.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum