sturner (2/20/2013)
you are running bcp from a shell, so get the current date (M/D/Y) part into a variable:set DATEVAR=%DATE:~4,10%
as part of a filename you probably want to change the / to - like this:
set mydate=%DATEVAR:/=-%
then you can use %mydate% in your batch command wherever you want the current date, like today would be: 02-20-2013
What language are you using? This doesn't appear to be T-SQL.
Never mind. I get it. These are batch commands at the command line level. Well done.
Can you think of a way to have the date come out in the ISO format of YYYYMMDD to support sortable file names using the batch commands?
--Jeff Moden
Change is inevitable... Change for the better is not.