Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with trying to combine Date and Time fields. Any help please?

Hello there,

I am trying to combine a date and time field together into one:

Job_Date
Job_Time
01/01/201500:11:23
04/01/201423:45:21
16/01/201510:21:33

I tried using:

timestamp#(Job_Date & ' ' & Job_Time,'DD/MM/YYYY hh:mm:ss') to get both of them in one field but this function seems to convert the date into numbers and keeps the time format strangely.

Any idea how I can get around this please?

1 Solution

Accepted Solutions
MarcoWedel

Instead of

timestamp#(Job_Date & ' ' & Job_Time,'DD/MM/YYYY hh:mm:ss')


try


timestamp(Job_Date+Job_Time,'DD/MM/YYYY hh:mm:ss')


or just


timestamp(Job_Date+Job_Time)


which uses your default timestamp Format.


Hole this helps


Regards


Marco

View solution in original post

18 Replies
jonasheisterkam
Partner
Partner

Hi,

if it is Date() and Time() you can use timestamp(Date+time). If you can not get it in time and date with the # functions use maketime/date.

Not applicable
Author

Hi Jonas,

Thanks for your reply. The original data is already in Date and Time format. Do you have a practical example of what to try with my two fields above?

MarcoWedel

Instead of

timestamp#(Job_Date & ' ' & Job_Time,'DD/MM/YYYY hh:mm:ss')


try


timestamp(Job_Date+Job_Time,'DD/MM/YYYY hh:mm:ss')


or just


timestamp(Job_Date+Job_Time)


which uses your default timestamp Format.


Hole this helps


Regards


Marco

View solution in original post

rwunderlich

You were close with your first attempt. The internal value for a datetime is an integer day since dec 31 1899 and time is represented as a fraction. Today at noon is 42027.5 

add in a  timestamp() formatting function to get the result you want.

timestamp(timestamp#(Job_Date & ' ' & Job_Time,'DD/MM/YYYY hh:mm:ss'))

sunny_talwar

Is this what you are trying to achieve? PFA

Best,

S

Not applicable
Author

Ah now I understand! Thank you so much Marco and Jonas!

Not applicable
Author

Yes thank you Sunindia!

Not applicable
Author

Hi guys,

I have one more problem

When I use a certain date field as part of time stamp it gives me the date and time from the date field.

When I add a time field to it, suddenly I get no results even though the time field is populated with values!

Any ideas?

sunny_talwar

The time field is showing up. Isn't this what you want?

Best,

S