Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 30th, 2013, 04:37 AM
menssanvi menssanvi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2013
Posts: 6 menssanvi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 7 sec
Reputation Power: 0
Sql development

I have output this from MS Access. Trying to rewrite it in sql server using case statment but getting stock. Can anywone help? thanks in advance


------------
SELECT M_accdi.wh_acc_no, (M_accdi.ACCRD_INT+M_accdi.dr_bal) AS Balance
, M_accdi.IntOnlyInd AS Int_Only_Ind
, IIF(M_accdi.REPAYMT_INTERVAL=3,4
,IIF(M_accdi.REPAYMT_INTERVAL=6,2
,IIF(M_accdi.REPAYMT_INTERVAL=7,52
,IIF(M_accdi.REPAYMT_INTERVAL=12,1
,IIF(M_accdi.REPAYMT_INTERVAL=14,26,12))))) AS Divisor
,((IIF(M_accdi.CNTRACT_MATURITY_DTE IS NULL,M_accdi.NXT_REPRICING_DTE
,M_accdi.CNTRACT_MATURITY_DTE)-#12/31/2012#)/365.25) AS Resid_Mat
, IIF(((IIF(M_accdi.CNTRACT_MATURITY_DTE IS NULL
,M_accdi.NXT_REPRICING_DTE,M_accdi.CNTRACT_MATURIT Y_DTE)-#12/31/2012#)/365.25)<=0,1,
CInt(IIF(M_accdi.REPAYMT_INTERVAL=3,4,IIF(M_accdi. REPAYMT_INTERVAL=6,2
,IIF(M_accdi.REPAYMT_INTERVAL=7,52,IIF(M_accdi.REP AYMT_INTERVAL=12,1
,IIF(M_accdi.REPAYMT_INTERVAL=14,26,12)))))*((IIF( M_accdi.CNTRACT_MATURITY_DTE IS NULL
,M_accdi.NXT_REPRICING_DTE,M_accdi.CNTRACT_MATURIT Y_DTE)-#12/31/2012#)/365.25)
)) AS Num_Payments, M_accdi.acc_dr_int_rte/100 AS acc_dr_int_rte
, M_accdi.repaymt_amt, M_accdi.Var_Ind, M_accdi.DEFAULT
FROM M_accdi;

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Sql development


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap