I am currently working on an MS Access database, and am having problem with date subtraction. 

Essentially I am trying to create a target date for example:

Target Date = Deadline - Lead Time

i.e. the lead time could be 30 days, therefore the target date should be 30 days prior to the deadline.

The code I am trying to use is this:

```
strSQL = "INSERT INTO dbo_DEALER_TASK ( Dlr_Number, Action_Id, Task_Id, Area_Id, 
Task_Deadline_Date, Responsible_Person_Id, Alternate_Person_Id, Priority, Comment, 
Suppress_Email, Dealer_Type ) "

strSQL = strSQL & "SELECT dbo_DEALER_ACTION.Dlr_Number, dbo_DEALER_ACTION.Action_Id, 
qryAllTasksToAdd.Task_Id, qryAllTasksToAdd.Area_Id, Deadline_Date - Deadline_adjustment 
AS 'Task_Deadline_Date', qryAllTasksToAdd.Person_Responsible_Id, 
qryAllTasksToAdd.Alternate_Responsible_Id, qryAllTasksToAdd.Priority, 
qryAllTasksToAdd.Comment, qryAllTasksToAdd.Suppress_Email, 
qryAllTasksToAdd.Applies_To_Dealer_Type "

strSQL = strSQL & "FROM dbo_DEALER_ACTION LEFT JOIN qryAllTasksToAdd ON 
(dbo_DEALER_ACTION.Dealer_Type = qryAllTasksToAdd.Applies_To_Dealer_Type) AND 
(dbo_DEALER_ACTION.Action_Id = qryAllTasksToAdd.Action_Id) "

strSQL = strSQL & WHERE (((qryAllTasksToAdd.Task_Id)=" & Me.Task_Id & ") AND 
((dbo_DEALER_ACTION.Date_Completed) Is Null));"

DoCmd.RunSQL strSQL

```

When the VBA code executes the statement, everything is updated correctly, except for the Task\_Deadline\_Date field, which is being left blank. 

What is really confusing me though is if I run this SQL statement standalone it is working as expected. After trying a number of different ideas I tried to replace "Deadline\_Date - Deadline\_adjustment AS 'Task\_Deadline\_Date'" with a string literal date and the statement then worked fine

Does anybody have any ideas what is going wrong?

Thanks,

Chris