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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Symposium Database Fields

Status
Not open for further replies.

SuperTime

Programmer
Dec 21, 2004
183
US
I am trying to generate user defined reports in crystal 8.5 and for that I am using the Symposiums Sybase SQL database. I am stuck at one point where the records that are pulled in crystal from the database a is a number type. For exampled Logged In time is the actual time an employee loggs in, however when I pull that same field shows as a number or integer field. I tried to use the CTime(number) function, to convert it, but that does not work. It gives me junk value.

Please let me know if anyone has worked on the same thing or if you have any clue to fix this.

Thanks
 
Create a Pivot table in Excel and see are you getting the same data? Just a taught,

Cheers,

Killian,

NextiraOne Ireland
 
I've done quite a few custom reports in Crystal; what database view are you pulling from, and what is the field you are displaying? I'm not sure I completely understand your question I guess. -Matt

Matt H.
TMC - KCMO, USA
 
Ok I got that working, the data was stored as seconds in the table. So I linked the two tables and then wrote a code to convert seconds to hh:mm:ss. So now i can display that on my report.

However I am now wanted someone to help on code for converting the hh:mm:ss field on my report to a seconds

for example converting 05:27:56 to 19676 (which is in seconds)

I would appreciate your help.

Thanks
 
In Crystal Reports, let's assume your field with HH:MM:SS is called "duration" so the formula would be:
(hour(duration)*3600)+(minute(duration)*60)+(second(duration))
If I read your question correctly. That's assuming that the field "duration" truly is a HH:MM:SS field, and not just a string of characters. Make sense?

Matt H.
TMC - KCMO, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top