There are a couple of reasons why you would be getting errors:
First, is date a datetime variable? If it is just a date variable, then you wouldn't need the datepart function.
Second, you are missing one character from the date and you have some superfluous characters. It should read:
'23DEC2011'd
Third you specify a non-existent variable, namely "date of loan". Wasn't it just "date"?
As for building a macro, if you are going to run it every day, why not just specify the date in the where statement relative to the current date. e.g., use the today() function or, if you want it to be x number of days from the current date,
where date=today()-8 (or whatever x is).