I am trying to construct a SQL Server Stored Procedure with the following objective in mind:
Date Field A <= Date Field B
----------------------------
Date Field B is calculated as follows:
lstYear (Year value in the format CCYY selected by the user from a list box) minus tblA.intNumYr (an integer value from table A). The month and date for Field B is a fixed value of 9/30. Thus, 9/30/????
For exammple, if the lstYear value is 2004 and the intNumYr value is 4 then
Date Field B is 9/30/2000 (2004 - 4).
Do you know how I could represent this date comparison
in a SQL Server Stored Procedure ?
I had originally used a DateSerial function to represent this date comparison in my Access application but when I converted the DateSerial function to a SQL Server Stored Procedure I discovered that it is not a valid function in SQL Server Stored Procedures.
Date Field A <= Date Field B
----------------------------
Date Field B is calculated as follows:
lstYear (Year value in the format CCYY selected by the user from a list box) minus tblA.intNumYr (an integer value from table A). The month and date for Field B is a fixed value of 9/30. Thus, 9/30/????
For exammple, if the lstYear value is 2004 and the intNumYr value is 4 then
Date Field B is 9/30/2000 (2004 - 4).
Do you know how I could represent this date comparison
in a SQL Server Stored Procedure ?
I had originally used a DateSerial function to represent this date comparison in my Access application but when I converted the DateSerial function to a SQL Server Stored Procedure I discovered that it is not a valid function in SQL Server Stored Procedures.