On 8/19/18, Misfer Al-Shamrani <binghar...@gmail.com> wrote:
> Hi everyone,
>
> I’m looking for the proper presentation (syntax) that will use a dynamic
> value from the table instead of a fixed value as given in the common example
> below:
>
> SELECT date('now','+1 month’);
>
> = 2018-09-18
>
> I want to replace the ( “+1” ….. months) with a dynamic value from my table
> field named “Months_Later” (integer datatype)  to give the date after the
> number of months in that field.


   SELECT date('now',printf('%+d months',tab.Months_Later)) FROM tab;

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to