<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>23 Mar 2016 16:45:00 Z</lastBuildDate><pubDate>23 Mar 2016 16:08:00 Z</pubDate><description>I have an SQL query with a subselect that uses case statements to return Date and Days. Is there a way to add the Days to the Date and still have a valid Date?&#13;
&#13;
The following code is as far as I have gotten. The last line won't work all the time.&#13;
20161105 + 30 days = 20161135 instead of 20161205. If I get rid of WL.Val() it appends the two expressions as strings (20161105 + 30 = 2016110530).&#13;
&#13;
SELECT * FROM( SELECT ID,CASE WHEN Date3 &lt;&gt; '' THEN Date3 WHEN Date2 &lt;&gt; '' THEN Date2 WHEN Date1 &lt;&gt; '' THEN Date1 ELSE '' END AS Date, CASE WHEN Date3 &lt;&gt; '' THEN Days3 WHEN Date2 &lt;&gt; '' THEN Days2 WHEN Date2 &lt;&gt; '' THEN Days1 ELSE '' END AS Days) FROM Schedule WHERE Date &lt;&gt; '' AND Days &lt;&gt; '') WHERE WL.Val(Date) + WL.Val(Days) &gt; SUBSTRING(SysDate,0,8)</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date/read.awp</link><title>[WD20] SQL - Add Days to Date</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57003/read.awp</comments><pubDate>23 Mar 2016 16:45:00 Z</pubDate><description>Good call.&#13;
&#13;
WHERE WL.DateDifference(Date,SUBSTRING(SYSDATE,0,8)) &gt; Days&#13;
Thanks!</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57003/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57003/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date/read.awp">[WD20] SQL - Add Days to Date</source><title>Re: [WD20] SQL - Add Days to Date</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57002/read.awp</comments><pubDate>23 Mar 2016 16:27:00 Z</pubDate><description>Hey Curtis,&#13;
&#13;
If you know the number of days, then why not turn your logic around a bit so the result is the difference (in day…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57002/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date-57002/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57001-wd20-sql-add-days-date/read.awp">[WD20] SQL - Add Days to Date</source><title>Re: [WD20] SQL - Add Days to Date</title></item></channel></rss>
