Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM ODBC Driver » View Thread |
Messages 1 to 2 of 2 total |
Problem in SQL Query |
Wed, Sep 12 2012 11:33 AM | Permanent Link |
kostas | Hello
I’m still working with the same project and I have a question for an error The following query works fine "SELECT sCode as Κωδικός, sName as Περιγραφή,sUnitOM as ΜΜ,sSuplCode AS ΚωδΠρομηθευτή,sWhsalePr as Λιανική,sRetailPr as ΛιανικήΦΠΑ,sComments as Μάρκα,(sInOpenQnt+ sInYearQnt - sOutYrQnt - sAllocQnt) as Διαθέσιμα, case when sComments like '%BMW%' then (sWhsalePr - sWhsalePr * 20/100) else (sWhsalePr - sWhsalePr * 50/100) END From smast where sCode like '1%' or sSuplCode like '%' order by scode" When I’m giving the column a name with the AS clause before the END "SELECT sCode as Κωδικός, sName as Περιγραφή,sUnitOM as ΜΜ,sSuplCode AS ΚωδΠρομηθευτή,sWhsalePr as Λιανική,sRetailPr as ΛιανικήΦΠΑ,sComments as Μάρκα,(sInOpenQnt+ sInYearQnt - sOutYrQnt - sAllocQnt) as Διαθέσιμα, case when sComments like '%BMW%' then (sWhsalePr - sWhsalePr * 20/100) else (sWhsalePr - sWhsalePr * 50/100) as Κόστος END From smast where sCode like '1%' or sSuplCode like '%' order by scode" then I get the error System.Data.Odbc.OdbcException: ERROR [42000] [Elevate Software][ElevateDB] ElevateDB Error #700 An error was found in the statement at line 1 and column 322 (Expected END but instead found as) Can you help me? |
Wed, Sep 12 2012 3:35 PM | Permanent Link |
Raul Team Elevate | Kostas,
IThis looks like ElevateDB and not DBISAM (you're posting in DBISAM newsgroup). The error pinpoints the exact problem - you are not ending your case when end properly. You need to use CASE WHEN ... THEN ... ELSE ... END AS <new name> instead you're using CASE WHEN ... THEN ... ELSE ...AS <new name> END Raul On 9/12/2012 11:33 AM, kostas wrote: > Hello > I’m still working with the same project and I have a question for an error > The following query works fine > > "SELECT sCode as Κωδικός, sName as Περιγραφή,sUnitOM as ΜΜ,sSuplCode AS ΚωδΠρομηθευτή,sWhsalePr as Λιανική,sRetailPr as ΛιανικήΦΠΑ,sComments as Μάρκα,(sInOpenQnt+ sInYearQnt - sOutYrQnt - sAllocQnt) as Διαθέσιμα, case when sComments like '%BMW%' then (sWhsalePr - sWhsalePr * 20/100) else (sWhsalePr - sWhsalePr * 50/100) END From smast where sCode like '1%' or sSuplCode like '%' order by scode" > > When I’m giving the column a name with the AS clause before the END > > "SELECT sCode as Κωδικός, sName as Περιγραφή,sUnitOM as ΜΜ,sSuplCode AS ΚωδΠρομηθευτή,sWhsalePr as Λιανική,sRetailPr as ΛιανικήΦΠΑ,sComments as Μάρκα,(sInOpenQnt+ sInYearQnt - sOutYrQnt - sAllocQnt) as Διαθέσιμα, case when sComments like '%BMW%' then (sWhsalePr - sWhsalePr * 20/100) else (sWhsalePr - sWhsalePr * 50/100) as Κόστος END From smast where sCode like '1%' or sSuplCode like '%' order by scode" > > then I get the error > > System.Data.Odbc.OdbcException: ERROR [42000] [Elevate Software][ElevateDB] ElevateDB Error #700 An error was found in the statement at line 1 and column 322 (Expected END but instead found as) > > Can you help me? > |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |