Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2010, 02:37 AM
Registered User
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incorrect Syntax near ','.

Hi All I am receiving a error for incorrect syntax

I am trying to work out the excluding vat value per item

Herewith the code

cmd.CommandText = "SELECT clerkName, dateTime, dateTime, saleNum, round((cast(stockUnitPrice as money)/(1+(cast(vatPercentage as money)/100)),3) as Excl_Selling FROM " & table.tableName & " WHERE round((cast(stockUnitPrice as money)/(1+(cast(vatPercentage as money)/100)),3) as Excl_Selling < 0 ORDER BY clerkName"

This is how I tested it in sql server

use db_my_stores
Select stockCode, stockUnitPrice as incl_Selling,
round((cast(stockUnitPrice as money)/(1+(cast(vatPercentage as money)/100))),3) as Excl_Selling from tbl_072009C0004R0001B0001_SALESLINES
 
Old August 13th, 2010, 03:06 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Your test and the commandtext are not the same. You have different number of parenthesis, right next to the "," where the error is telling you to look.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect syntax near '.' meraj ADO.NET 6 February 27th, 2012 01:01 AM
Incorrect syntax near '{'. bobmc BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 1 July 21st, 2010 02:59 PM
Incorrect syntax near 'GO' vanik.cz Pro VB Databases 11 May 11th, 2009 04:59 PM
Incorrect syntax near '`' Hez Classic ASP Databases 3 August 5th, 2004 08:13 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.