Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-11-10 : 07:55:16
|
| Hi,This is oracle querySELECT ((SELECT password_expiry FROM EMRLOGINCONFIGINFO WHERE group_id = PGroupid) - ROUND((to_date(PCurrentDate, 'yyyy-mm-dd HH24:MI:SS') - password_created_on),0)) INTO PCountDays FROM (SELECT max(password_created_on) as password_created_on FROM emrpasswordhistory WHERE Ltrim(Rtrim(Upper(USER_LOGIN))) = Ltrim(Rtrim(Upper(PLoginName))) ) x ;i have written it in mssql like thisSELECT @PCountDays=((SELECT password_expiry FROM EMRLOGINCONFIGINFO WHERE group_id = @PGroupid) -ROUND((Convert(Varchar(35),@PCurrentDate,120) - password_created_on),0))) FROM (SELECT max(password_created_on) as password_created_on FROM emrpasswordhistory WHERE Ltrim(Rtrim(Upper(USER_LOGIN))) = Ltrim(Rtrim(Upper(@PLoginName))) x ;getting exception asMsg 102, Level 15, State 1, Procedure EZChkLogin, Line 114Incorrect syntax near ')'.Msg 102, Level 15, State 1, Procedure EZChkLogin, Line 115Incorrect syntax near 'x'.please help me in solving this |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-10 : 08:03:33
|
| TrySELECT @PCountDays=(SELECT password_expiry FROM EMRLOGINCONFIGINFO WHERE group_id = @PGroupid) -ROUND((Convert(Varchar(35),@PCurrentDate,120) - (SELECT max(password_created_on) as password_created_on FROM emrpasswordhistory WHERE Ltrim(Rtrim(Upper(USER_LOGIN))) = Ltrim(Rtrim(Upper(@PLoginName))))),0)MadhivananFailing to plan is Planning to fail |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-11-10 : 08:04:42
|
having the table schemas would REALLY help.and some sample data, and desired output. Follow the "How to ask" link and it will show you what we need to really help.[EDIT] or madhi-bot will answer right away. http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-13 : 05:11:41
|
quote: Originally posted by DonAtWork having the table schemas would REALLY help.and some sample data, and desired output. Follow the "How to ask" link and it will show you what we need to really help.[EDIT] or madhi-bot will answer right away. http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
But the OP dont have an habit of replying back MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|