Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
import database tabase
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
import database tabase
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 "Carmen" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import from Excel into database using jet in VB.net | Excel Discussion (Misc queries) | |||
database query not showing foxpro database How I import data | New Users to Excel | |||
OT? Microsoft Works Database Import? | Excel Worksheet Functions | |||
import paradox database into excel | Excel Discussion (Misc queries) | |||
Import of Database VB app into Excel Spreadsheet | Excel Programming |