Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 13th, 2010, 03: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
  #2 (permalink)  
Old August 13th, 2010, 04:06 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,133
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?
 


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03:59 PM
Incorrect syntax near 'GO' vanik.cz Pro VB Databases 11 May 11th, 2009 05:59 PM
Incorrect syntax near '`' Hez Classic ASP Databases 3 August 5th, 2004 09:13 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 12:14 PM



All times are GMT -4. The time now is 11:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.