Can the following Dynamic SQL statement be converted to a MS SQL Stored Procedure and if so, how ?
I realize that CDate is not a valid function in MS SQL Server Stored Procedures.
For an example:
Assume that cbYr has a value of 5 (it's an integer value between 1 and 5).
Assume Forms!frmC.lstYrs.Value has value of 2005.
In this example, I want to select all records in tblA whose DateA value is less than or equal to the value 9/30/2000 (2005 - 5).
Select ...
WHERE tblA.DateA <= CDate(DateAdd("yyyy",cbYr * -1,"9/30/" & Forms!frmC.lstYrs.Value))
I realize that CDate is not a valid function in MS SQL Server Stored Procedures.
For an example:
Assume that cbYr has a value of 5 (it's an integer value between 1 and 5).
Assume Forms!frmC.lstYrs.Value has value of 2005.
In this example, I want to select all records in tblA whose DateA value is less than or equal to the value 9/30/2000 (2005 - 5).
Select ...
WHERE tblA.DateA <= CDate(DateAdd("yyyy",cbYr * -1,"9/30/" & Forms!frmC.lstYrs.Value))