I have a use case where I want to use the "Wait by Attribute" function in Journey Builder to wait until a specific time of day to send and I need to figure out the SQL to change just the hour and minute portions of the attribute field to be the time of day I want to send while keeping the day, month, year the same.
1 Answer
Figured it out using the DATEADD function to add a fractional day to the date.
DATEADD(DAY, DATEDIFF(DAY, 0, LOAD_DATE), 0.625) AS SEND - 3DateAdd() also allows you to add hours (hour, hh) minutes (minute, mi) seconds (second,ss,s) and milliseconds (millisecond,ms). This is not to say your fractional day is not a solution, just that there may be a more 'readable' solution through one of these.Gortonington– Gortonington2021-02-17 13:29:36 +00:00Commented Feb 17, 2021 at 13:29