Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 May 3rd, 2007, 02:44 PM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ampersand SQL equivalent

When doing a pass through query SQL characters must be used. So, is there an equivalent to an ampersand? The following query works in within Access databases, but if you put the same query in an SQL database the ampersand character is not recognized.


SELECT OrderID & BundleName As OrderBundle
FROM dbo.OrderBundle
WHERE LineNumber <1000
GROUP BY OrderID, BundleName
ORDER BY OrderID, BundleName

Thanks for any help you can give me.

Coby.


 
Old May 4th, 2007, 06:25 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Access uses ANSI SQL 89 while SQL Server uses ANSI SQL 92. Try either putting the SQL string in a string variable, or do this:

SELECT ([OrderID] & [BundleName]) As OrderBundle
...

ANSI 92 should support the older syntax.

Did that work?



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
vb Format equivalent in SQL debbiecoates Access VBA 2 November 5th, 2008 03:22 PM
Update query equivalent in SQL Mitch SQL Server 2000 5 May 5th, 2005 05:14 AM
AMPERSAND disappears when given along with # happygv Forum and Wrox.com Feedback 2 October 25th, 2004 09:49 PM
SQL "like" equivalent in XSLT AForgue XSLT 5 December 4th, 2003 02:11 AM
ampersand in a querystring trangd Beginning PHP 3 October 23rd, 2003 07:54 PM





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