Building on my previous attempt (successful) to automated a daily report for the current day, I’m now trying to build one that runs for the previous day.
The select is fine and works perfectly. The automation script is great as well. The problem I’m having is generating the previous day’s date in the format that I need.
I’m using: DateAdd(“d”,-1,Now()) which gives me the correct date, but in a format that I can’t use in the file name (ie. 12/15/2010 7:52:27 PM). What I really need is to return a date in the format of YYYYMMDD or 20101215 as the date is inserted as part of the export file name.
I’ve tried variations on Format(Date(‘yyyyMMdd’),“yyyymmdd”) which I had used in my same-day automation script, but haven’t had any success (Expression Builder indicates an error).
Anyone have any ideas?