Time to Integer;Integer to Time?

Analytics
Enthusiast

Time to Integer;Integer to Time?

Dear who can help,

I had a data table,Cust_Usage
When I create 100 samples data from the table Cust_Usage,
The time format(00:00:00) from Cust_Usage change to '133818'(Integer).

My query as simple as this,
Sel * From Cust_Usage Sample 100

1) How to remain the time format when I create the sample data(100 sample table)?
2) How to convert the Time (Integer) back to Time (00:00:00)?

Many Thanks.

3 REPLIES
Enthusiast

Re: Time to Integer;Integer to Time?

For whom still trying, I got the answer.

--query
Sel Cast(Usg_Time as Time(2) )
From Cust_Usage.

Junior Contributor

Re: Time to Integer;Integer to Time?

Hi Benjamin,
did you run that query using BTEQ?

Looks like there's a FORMAT 'HHMISS' on usg_time and the CAST is changing it back to the default format.

Dieter
Enthusiast

Re: Time to Integer;Integer to Time?

No, i did not run it on BTEQ.
Yes, I just want to change it back to the original format.