title: changing a date with biweekly data MYSQL
body: <p>I have downloaded a file that has biweekly data.  Since no program includes option to handle such format, I have tweaked my own function to load such format.  The code looks like this:  </p>
  
  <pre><code>LOAD DATA LOCAL  
  INFILE '/my_folder/servicios.csv' 
  INTO TABLE SERVICIOS
  FIELDS TERMINATED BY ','
  OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  IGNORE 2 LINES
  (@periodo, MERCANCIAS, SERVICIOS, INPC, ENERGETICOS)
  SET PERIODO = (SELECT IF(DAY(ld.prd) = 2, ADDDATE(ld.prd,14), ld.prd) 
          FROM (SELECT DATE(@periodo) AS prd) ld);
  </code></pre>
  
  <p>What the SET statement does is to keep '2014/10/01' for the first week as is, but turn '2014/10/02' for the second week to '2014/10/16'.</p>
  
  <p>I understood that I can include subqueries in SET section of LOAD DATA statement.  However, all I get are NULL values.  If I do the query outside I get the right thing.  Can anyone point me where I'm failing?  </p>
  
  <p>Best regards, </p>