AnsweredAssumed Answered

SQL to NSQL Help

Question asked by TomConnery on May 5, 2010
Latest reply on May 7, 2010 by Dave
Would anyone mind helping me convert this to NSQL?   I thought about creating a view with the subselect and then using NSQL to fetch it from there..     any recommendations, let me know.    The script below displays recent created users within a certain or limited range and I was hoping to display this in a portlet.  Thanks!    select ID,LAST_NAME,FIRST_NAME,USER_NAME,LAST_LOGGED_IN_DATE,CREATED_DATE,TODAYS_DATE,OLDEST_DATE,DiffDate,STATUSIDFROM
(
 Select ID, LAST_NAME, FIRST_NAME,USER_NAME, LAST_LOGGED_IN_DATE, CREATED_DATE, (GETDATE())as TODAYS_DATE,(getdate()-90) as OLDEST_DATE,DATEDIFF(day,CREATED_DATE,getdate()) AS DiffDate,
CASE WHEN USER_STATUS_ID = 200 THEN 'Active' WHEN USER_STATUS_ID = 201 THEN 'Inactive' ELSE 'Locked' END AS STATUSID  FROM CMN_SEC_USERS
 
) SUBSELECT1WHERE DiffDate

Outcomes