I call a stored procedure with a datetime parameter from the ADP Access 2003 project, it gives an error
Incorrect syntax around '-'
I tried different date formats, but the same type of error is repeated, only the constructions are different.
Call from code
Me.items.Form.RecordSource = "exec usp_pct_ItemForTree " & cur & "," & usl & ",-1,1,'" & Nz(fltr, "") & "'" & "," & Abs(Nz(inet, 0)) & "," & idb & "," & DueDate Stored procedure
alter procedure [dbo].[usp_pct_ItemForTree] @group_id int=21 ,@instoreonly int=1 ,@idbrand int=-1 ,@hotim bit=1 ,@fltr varchar(150)='' ,@inet bit = 0 ,@idbill int=null ,@dueDate datetime = null Date example
2015-09-22 String after concatenation
"exec usp_pct_ItemForTree 0,6,-1,1,'',0,5425157,2015-09-22"