DANDARSMASH
Programmer
Hello. I'm making a routine to run daily in SQL Workbench. I want the exported file to have curdate() added to the name for organizational purposes.
The trouble line is: INTO OUTFILE '/tmp/' CURDATE();.'letters.csv' I want it to output to /tmp/2013-06-11letters.csv but I can't figure out how to concatenate.
"Any sufficiently advanced technology is indistinguishable from magic" [Arthur C. Clark]</td></tr></table>
SQL:
SELECT
d.emailaddress,
d.fullname,
d.address,
d.city,
d.state,
d.zip,
d.makepayabletoname,
d.makepayabletoaddress,
d.makepayabletocity,
d.makepayabletostate,
d.makepayabletozip,
p.filenumber,
p.paymentstatus,
p.paymentamount,
p.paymentdate
INTO OUTFILE '/tmp/' CURDATE();.'.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '/\n'
FROM payments p
JOIN dbase d
ON p.filenumber = d.filenumber
WHERE p.paymentstatus = 'PENDING'
AND p.paymentdate = CURDATE();
The trouble line is: INTO OUTFILE '/tmp/' CURDATE();.'letters.csv' I want it to output to /tmp/2013-06-11letters.csv but I can't figure out how to concatenate.
"Any sufficiently advanced technology is indistinguishable from magic" [Arthur C. Clark]</td></tr></table>