
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add Hours to Timestamp
Is there a simple way to add hours to a date. I am hoping that it is not a long converting & concatenating.
Thanks,
Dinesh.
- Tags:
- new_to_qlikview
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it's a field containing a numeric number of hours:
timestamp(MyDate + NumberOfHours/24)
Or if you're adding a specific number of hours:
timestamp(MyDate + 50/24)
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Dinesh,
Use the following example
=Date(Date('02/03/2010') + time('22:30', 'hh:mm'), 'DD/MM/YYYY hh:mm:ss')
Hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dinesh,
Try this: timestamp(date#('01/01/2010','MM/DD/YYYY') + maketime(10))
where 01/01/2010 is your date and 10 is the # of hours you want to add. If you have a date field, it would look like this:
timestamp(mydatefield + maketime(10)) as newdatefield
Regards,


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it's a field containing a numeric number of hours:
timestamp(MyDate + NumberOfHours/24)
Or if you're adding a specific number of hours:
timestamp(MyDate + 50/24)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Miguel,
My problem is the inverse. I need to know only hours to compare with a specific value.
I need to compare a DtField which has this format 'DD-MM-YYYY hh:mm:ss' with a value Date#('06:30','hh:mm').
If its bigger than 6:30, count a Quantity of another field.
But comparing isnt working. I need maybe to broke in a new field?
Thanks !
