Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to concatenate date and hour?

I need concatenate a date (come from a calendar) and a specificy hour to comparate with a date/hour come from DB.

per example:

A user select a date, 01/01/2010, and i need 01/01/2010 12:00:00 to compare a field.

i try

DATE(vDATA,'DD/MM/YYYY 12:00:00') where vDATA come from a calendar object but doesn´work!

Anyone have some idea???

tks!!!!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try

vDATA+MakeTime(12)

or if you need the formatted version:

Timestamp(vDATA+MakeTime(12))

-Rob

View solution in original post

5 Replies
Not applicable
Author

You can make it by many different ways. Here are some:

= date#('01/01/2010') & ' \n' &
date( date#('01/01/2010') + 12/24, 'M/D/YYYY hh:mm:ss[.fff]') & ' \n' &
date( date#('01/01/2010') & ' 12:00:00', 'M/D/YYYY hh:mm:ss[.fff]')


Not applicable
Author

Is not work when i put a variable!!!

Not applicable
Author

Field or Variable?

All what you need is to replace this date#('01/01/2010') by field name. Or if you use a variable, maybe, you need to convert data from variable into proper date or string type according to approach which you've decided to follow up.

Field approach:

date( <your date field name> + 12/24, 'M/D/YYYY hh:mm:ss[.fff]')
Don't use <>.

Variable approach:

date( date#('$(<your variable name>)') + 12/24, 'M/D/YYYY hh:mm:ss[.fff]')
Don't use <>.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try

vDATA+MakeTime(12)

or if you need the formatted version:

Timestamp(vDATA+MakeTime(12))

-Rob

Not applicable
Author

Tks a lot...

that´s work well!!!