Need more, need help now?
- - - - - - - - - - - - - - - - - - pay-as-you-go support - no contract - tenth of an hour billing - expert help - fast service - no call queues
Need integration?
- - - - - - - - - - - - - - - - - - with your shipping system - website - invoicing system - crm - cms - manufacturing - order import - back to back orders..
Need a report?
- - - - - - - - - - - - - - - - - - Excel reporting that pulls data from Sage - custom layouts - layouts that change adapt to your brands and/or for drop shipping.
Want web hosting?
- - - - - - - - - - - - - - - - - - Your own domain name - email - a shop - wordpress - woo commerce - ticket systems - help desks - forums - portals

ODBC Queries, Escaping text/reserved keywords

Sage 50 general help forum - Free help and support for all general issues
Post Reply
stevenmu

ODBC Queries, Escaping text/reserved keywords

Post by stevenmu » 20 Feb 2007, 12:09

Hi all,

I have a query to list all the delivery addresses for a selected client, in short

Code: Select all

SELECT ACCOUNT_REF, DESCRIPTION, NAME, ADDRESS_1,ADDRESS_2, ADDRESS_3, ADDRESS_4, ADDRESS_5, TELEPHONE, FAX, E_MAIL
FROM            SALES_DEL_ADDR
WHERE        (ACCOUNT_REF = 'xxx')
This works fine for all clients bar one whose code is MAX, which gives me a "Syntax error: Invalid filter in where clause". This seems to be because MAX is an aggregate function/reserved keyword (and testing others seems to confirm this).

Is there any way to force the ODBC driver to see this as just another string instead of a keyword ?

(I've tried apostrophes, inverted commas etc, and using LIKE instead of = )


Cheers,
Steve.

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4664
Joined: 28 Feb 2006, 09:56
Sage Version: v30 UK/Europe/Africa

Post by brucedenney » 26 Feb 2007, 08:52

Wow! this is very tough.

Have you tried lowercase?
For just about anything Sage :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, analysis or any other help making life with sage easier/less time consuming Contact me.

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4664
Joined: 28 Feb 2006, 09:56
Sage Version: v30 UK/Europe/Africa

Post by brucedenney » 26 Feb 2007, 17:02

Another solution is to change the name of the account, from MAX to something else.

We have a tool to do it.
For just about anything Sage :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, analysis or any other help making life with sage easier/less time consuming Contact me.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 1 guest