Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,651 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need help in converting the Access SQL Script to SQL Script. Any help will be appreciated.
[STATUE] data type is nvarchar 'eg:20250510'
I don't know Access, so I don't know what the first script is achieving, but if it is computing a difference in days, that would be
IIF (datediff(DAY, sysdatetime(), STATUTE) > 540, 'Yes', 'No') AS Stat2005
The second could be
datediff(MONTH, sysdatetime(), STATUTE) AS St.
To note: