You are here: Plz Help me out in this query « MsSQL Server « IT news, forums, messages
Plz Help me out in this query

Posted by Roni on 11/17/06 13:22

Declare @i int
Select @i=D_Places from MachineTests Where Test_Name='WBC_Count'
--Where D_Places is a user defined Number which defines the scale for
this Test
--While Converting it to Decimal

-- What does the following query do
-- I need to check the flag FORCE_HOLD_NDR if its 1 then
-- conversion is done on Result field of MachineResults Table

Select Case(FORCE_HOLD_NDR)
WHEN 1 THEN convert(DECIMAL(18,@i), Result)
ELSE Result
END
>From MachineResults

--Sounds really easy :) but its prompting me an Error
--"Server: Msg 170, Level 15, State 1, Line 5
--"Line 5: Incorrect syntax near '@i'."

/*
So the problem i m facing is in supplying a variable (@i in this case)
in Decimal constructor..

Is there any solution to remove this error however the bussiness
requiremt cant be
changed as the scale for the decimal is defined by the user in setup
file and it
can be anything ..

*/
Hope u guys Understand my question

Regards
Mohammad Rehan
Nortec Softwares Pvt LTD

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация