.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

error in the sql query

Posted By: vignahari     Posted Date: January 19, 2010    Points:2   Category :Sql Server
(SELECT SUM(CONVERT(FLOAT, CASE '01' WHEN '01' THEN CASE SIGN((sltr_tran_amt - ISNULL(sltr_matched_amt, 0))) WHEN 1 THEN CASE DBO.glas_aging_oth(CONVERT(DATETIME, '2009/04/04') - FLOOR(sltr_pstng_date)) WHEN 0 THEN (sltr_tran_amt - ISNULL(sltr_matched_amt, 0)) ELSE 0 END ELSE 0 END WHEN '02' THEN CASE SIGN((sltr_tran_amt - ISNULL(sltr_matched_amt, 0))) WHEN - 1 THEN CASE DBO.glas_aging_oth(CONVERT(DATETIME, '2009/04/04') - FLOOR(sltr_doc_date)) WHEN 0 THEN (sltr_tran_amt - ISNULL(sltr_matched_amt, 0)) ELSE 0 END ELSE 0 END END)) FROM WHERE CASE '01' WHEN '01' THEN sltr_pstng_date ELSE sltr_doc_date END = CASE '01' WHEN '01' THEN sltr_pstng_date ELSE sltr_doc_date END ) thirty_days,
from
glas_sl_transactions

hai friends this is my query
when i execute this query error is ocurring near 'where'
how to avoid this if possible pls tel me how to shorten this query

Responses
Author: Appu & Pappu             
Posted Date: January 22, 2010     Points: 5   

(SELECT SUM(CONVERT(FLOAT, CASE '01' WHEN '01' THEN CASE
SIGN((sltr_tran_amt - ISNULL(sltr_matched_amt, 0))) WHEN 1 THEN
CASE DBO.glas_aging_oth(CONVERT(DATETIME, '2009/04/04') - FLOOR(sltr_pstng_date))
WHEN 0 THEN (sltr_tran_amt - ISNULL(sltr_matched_amt, 0)) ELSE 0 END ELSE 0 END WHEN '02'
THEN CASE SIGN((sltr_tran_amt - ISNULL(sltr_matched_amt, 0))) WHEN - 1 THEN
CASE DBO.glas_aging_oth(CONVERT(DATETIME, '2009/04/04') - FLOOR(sltr_doc_date)) WHEN 0 THEN
(sltr_tran_amt - ISNULL(sltr_matched_amt, 0)) ELSE 0 END ELSE 0 END END))thirty_days FROM glas_sl_transactions WHERE CASE '01' WHEN '01'
THEN sltr_pstng_date ELSE sltr_doc_date END = CASE '01' WHEN '01' THEN sltr_pstng_date ELSE sltr_doc_date END )



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend