import database tabase

G

Guest

Hello,

I recorded the macro that creates a query table from MS Access. I'm
replacing the "Where..." SQL to something more flexible. ie, In excel I'm
allowing user to pick the criteria from 20+ fields (from a pivot). I'd like
to add to SQL all those fields that have a selection other than "All". (I'm
doing this because my end product can only be a query table).

I'm noticing that the querytable only refreshes with certain fields. Some
field selections do not work. Where could I find the requirements for the
string?

My field names/data are sometimes numbers, text (but numeric),
single/multiple words, phrases with "," or ".". I noticed that sometimes I
need to use " ' " and sometimes " ` ". But in what cases should I be using
them? Also, of field names are two words, should I use []?

Thanks,
Carmen
 
G

Guest

In general terms, it depends on the type of the field in the database. If
the field is type text then the value you are looking for needs to be
enclosed in quotes. If the field name has spaces in it then it needs to be
enclosed in [ ] Like [Field Name] = 'value'

Since you recorded a macro to show you how to make the query, you could
always record one where you set a condition on each of the fields to see what
is recorded for each field.

Peter Richardson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top