al4629740
asked on
display in time in a normal format
I am placing time values into my excel sheet in vb6
The time that I have in my DB looks like the following: DataType Time(7)
HourTimeFrom HourTimeTo
13:00:00.0000000 14:00:00.0000000
09:00:00.0000000 10:00:00.0000000
09:00:00.0000000 10:00:00.0000000
I am using the following query
SELECT r.RegID,h.HourTimeFrom,h.H ourTimeTo from tblOrgHours
I would like the output to return a standard time format or 1:00 PM
The time that I have in my DB looks like the following: DataType Time(7)
HourTimeFrom HourTimeTo
13:00:00.0000000 14:00:00.0000000
09:00:00.0000000 10:00:00.0000000
09:00:00.0000000 10:00:00.0000000
I am using the following query
SELECT r.RegID,h.HourTimeFrom,h.H
I would like the output to return a standard time format or 1:00 PM
Or in Excel format those columns with the "h:mm AM/PM" custom format. That might make it easier to perform calculations against those time values (instead of converting it into text).
ASKER
Russell,
I tried that route and it still shows up in the funky numbers
I tried that route and it still shows up in the funky numbers
ASKER
Using this method
SELECT CONVERT(VARCHAR(10), HourTimeFrom, 100) AS HourTimeFrom,
CONVERT(VARCHAR(10), HourTimeTo, 100) AS HourTimeTo
FROM tblOrgHours
Does it take up much more processing time? If so, is there a better way to do this?
Is there a DataType that addresses this issue?
SELECT CONVERT(VARCHAR(10), HourTimeFrom, 100) AS HourTimeFrom,
CONVERT(VARCHAR(10), HourTimeTo, 100) AS HourTimeTo
FROM tblOrgHours
Does it take up much more processing time? If so, is there a better way to do this?
Is there a DataType that addresses this issue?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CONVERT(VARCHAR(10), HourTimeTo, 100) AS HourTimeTo
FROM tblOrgHours