SQL Syntax Error

zeee

Registered User.
Local time
Today, 15:10
Joined
Jan 5, 2005
Messages
11
I get a Syntax error message when trying to save this query. Could someone point out what I am doing wrong?

SELECT
BEM_EXCEPTIONS.BEM_EXCEPTION_ID, BEM_EXCEPTIONS.BEM_EXCEPTION_DESC, BEM_EXCEPTIONS.BEM_EXCEPTION_TYPE, BEM_EXCEPTIONS.BEM_GROUP_ID, BEM_EXCEPTIONS.BEM_STATUS, BEM_EXCEPTIONS.BEM_AGE, BEM_EXCEPTIONS.BEM_PRIORITY, BEM_EXCEPTIONS.BEM_DATE_TIME_CREATION, BEM_EXCEPTIONS.BEM_CLOSED_AT_TIMESTAMP, BEM_EXCEPTIONS.BEM_LAST_UPDATED, BEM_EXCEPTIONS.BEM_ASSIGNED_USER, BEM_EXCEPTIONS.BEM_EVENT_ID, BEM_EXCEPTIONS.BEM_EVENT_VERSION, BEM_EXCEPTIONS.BEM_EVENT_TYPE, BEM_EXCEPTIONS.BEM_TRADE_ID, BEM_EXCEPTIONS.BEM_PROD_TYPE, BEM_EXCEPTIONS.BEM_ENTITY, BEM_EXCEPTIONS.BEM_BUSINESS_GROUP, BEM_EXCEPTIONS.BEM_BOOK, BEM_EXCEPTIONS.BEM_CPTY_ID, BEM_EXCEPTIONS.BEM_CPTY_LEGAL_NAME, BEM_EXCEPTIONS.BEM_CPTY_SENSITIVITY_LEVEL, BEM_EXCEPTIONS.BEM_CPTY_REGION, BEM_EXCEPTIONS.BEM_CPTY_COUNTRY, BEM_EXCEPTIONS.BEM_CPTY_TYPE, BEM_EXCEPTIONS.BEM_NOMINAL, BEM_EXCEPTIONS.BEM_CCY, BEM_EXCEPTIONS.BEM_VALUE_DATE, BEM_EXCEPTIONS.BEM_MATURITY_DATE, BEM_EXCEPTIONS.BEM_CONTACT_DETAILS, BEM_EXCEPTIONS.BEM_TRANSMISSION_MEDIA, BEM_EXCEPTIONS.BEM_SYS_INSTANCE_NAME
FROM BEM_EXCEPTION
WHERE
([Forms]![BemExceptionsQueryForm]![Descritption] & "*") AND
([Forms]![BemExceptionsQueryForm]![Queue] & "*" ) AND
([Forms]![BemExceptionsQueryForm]![Priority] & "*" ) AND
([Forms]![BemExceptionsQueryForm]![Status] & "*" ) AND
([Forms]![BemExceptionsQueryForm]![Entity] & "*" )AND
([Forms]![BemExceptionsQueryForm]![CptyID] & "*" ) AND
([Forms]![BemExceptionsQueryForm]![CptyType] & "*" ) AND
(BETWEEN [Forms]![BemExceptionsQueryForm]![VDateFrom] AND [Forms]![BemExceptionsQueryForm]![VDateTo] & "*" ) AND
(BETWEEN [Forms]![BemExceptionsQueryForm]![CreationateFrom] AND [Forms]![BemExceptionsQueryForm]![CreationDateTo] & "*") ;
 
What is this suppose to accomplish: ([Forms]![BemExceptionsQueryForm]![Descritption] & "*")?

I don't get your WHERE statement.
 
I am trying to capture the values the users type into text fields, or select from a combo box.
 
Then where are the =<> IN signs? What do you do with these values? Unless I'm mistaking, you just can't say WHERE NAME. It helps to say WHERE NAME = "Bob".
 
Let's make a test. If you remove your where clauses, can you save it?
 
Yes I can save the SQL if I take the WHERE clause out. I guess I am struggling with the syntax more than anything. If I had to do this through a web page then the sql statement would look something like this in Java...

String param1= parameter.getValue(fieldValue);

Select * from table_name where column1 = 'param1';

Where param1 is the value typed in by the users in the text field. Theproblem is I do not know how to do this in ACCESS.
 

Users who are viewing this thread

Back
Top Bottom