🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

date_add syntax

User: "aoneil"
New Altair Community Member
Updated by Jocelyn
My process is working with days (integers) as an input. I want to convert these 'day' values into a real date. I tried using date_add but no matter what type of date I put in (I want the date that I'm adding to to be November 1, 2015) it never converts properly. My most recent attempt is here: date_add(date_millis(2015-11-1 00:00:00.000), day, DATE_UNIT_DAY).

Is this remotely correct? I can't help but feel as if I'm doing something very stupid as I've tried quite a large set of date combinations to no avail.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "juanm_encinas"
    New Altair Community Member
    I think the problem is that date_millis(2015-11-1 00:00:00.000) is converting a date into a number. So, when applying date_add you are adding a certain amount of days to a number of milliseconds, not to a date.

    Try to remove the date_millis(...) function and use just the date instead.