Find and Replace - Date within SQL Query
Posted: 11 May 2010 05:23
Hi all,
i would want to extract some data from a sql database every day. The date of the scripts needs to be changed to match the current date. Every "find and replace" script is not working on these sql querys, and i'm not quite sure why.
I need help to change this line automaticly every day to both match the current date.
"and (pb2.pdatetime >= '2008/01/20') and (pb2.pdatetime <= '2010/12/20');"
This will "echo" will put out the right date:
set jahr=%date:~-4%
set monat=%date:~-7,2%
set tag=%date:~-10,2%
echo %jahr%/%monat%/%tag%
The whole sql statment has about 720 chars.
Thanks a million for every hint and help
Tarsinion
i would want to extract some data from a sql database every day. The date of the scripts needs to be changed to match the current date. Every "find and replace" script is not working on these sql querys, and i'm not quite sure why.
I need help to change this line automaticly every day to both match the current date.
"and (pb2.pdatetime >= '2008/01/20') and (pb2.pdatetime <= '2010/12/20');"
This will "echo" will put out the right date:
set jahr=%date:~-4%
set monat=%date:~-7,2%
set tag=%date:~-10,2%
echo %jahr%/%monat%/%tag%
The whole sql statment has about 720 chars.
Thanks a million for every hint and help
Tarsinion