Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date and Time Cast

Hi

I want to know how to make QV to understand my Movex DB2 Date and Time formats.
In Movex is the Date format is in one column in YYYYMMDD style and the time format in another column in HHMMSS style.

The thing is that an normal date and time is 20100115 154700 but when the time is 1 sec over midnigt then the time is only displayed as '1' ('YYYYMMDD' as date style byt only 'S' as timestyle instead of 'HHMMSS')

I have been using normal T-sql but I need to know how it is done in QV.
To solve this in T-SQL
timestamp(CONCAT(DATEFIELD, right(digits(TIMEFIELD),6)))

QV don't seems to handle the "DIGITS" function.

I have tested with Date / Time / cast functions with no success.

Thanx in advance for any replies

// Daniel

1 Solution

Accepted Solutions
Not applicable
Author

Have a look at the function num(), for example:

num(QORGTM, 000000)

View solution in original post

2 Replies
Not applicable
Author

Have a look at the function num(), for example:

num(QORGTM, 000000)

Not applicable
Author

Also look at the date#() and time#() functions. They read a date/time with the format you give it.


date#(DATEFIELD, 'YYYYMMDD') AS ...
time#(TIMEFIELD,'HHMMSS') AS ...


Or put them together to get a complete date field.