I want to substract numeric column from a date column and i'm using addday() fucntion

Hi, I want to substract numeric column from a date column and i'm using addday() fucntion as below- addday(xxbi_oe_order_lines_all_v.promise_date, mult (xxbi_oe_order_lines_all_v.delivery_lead_time,-1)) where 'xxbi_oe_order_lines_all_v.promise_date' is a date column and 'xxbi_oe_order_lines_all_v.delivery_lead_time' numeric column but this is not working. can you please help. Regards, Raj
user
09-11-2018 00:49:21 -0500

1 Answer

Hi, You are probably getting the error, because the mult expression has the wrong type. The function [addday](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/date_processing_functions#addday) needs an int or a long type field for the second parameter. You could use the [cast](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/type_conversion_functions#cast) function to convert the data type to int/long. Hope this helps!
Denodo Team
12-11-2018 07:41:59 -0500
You must sign in to add an answer. If you do not have an account, you can register here