Actually, it's not just true that you CAN use @BillingDate =
'2008-04-01T00:00:00.000', you MUST either do that (which will implicitly
convert the string to a datetime - that is not a problem since you have
correctly used one of the unambigous datetime formats) or assign the result
of the Cast() function to a variable and then pass that variable. You can
only pass values or variables as parameters, you are not allowed to pass an
expression. So either of the following is legal and should get you what you
want:
EXECUTE MONITORINGINVOICES @BillingDate = '2008-04-01T00:00:00.000',
@BatchNumber = 'xx1',
@User_Id = 'Bill', @InvoiceCount = 0
or
Declare @TempDate datetime
Set @TempDate = CAST('2008-04-01T00:00:00.000' AS DateTime)
EXECUTE MONITORINGINVOICES @BillingDate = @TempDate, @BatchNumber = 'xx1',
@User_Id = 'Bill', @InvoiceCount = 0
Tom