Using a cell to determine a value in a database query.

N

Nick Dangr

Hi folks,

I've run into a problem recently - maybe there's no good answer, then
again perhaps you can help me come to one.

I have a spreadsheet on which There are three entry fields:

start date
end date
store number

I've managed to map start date to [startdate] in a query and end date
to [enddate] - that seems to work fine. The problem I'm running into
now has to do with the store number field.

In the database, store number is a 4 character field, as of now the
numbers of the store are like 01,02,03,04..HQ,RO. When I try to map
store number to [storenum] in the query, I get no rows - nothing comes
back to excel.

I did a little playing with the query and I've figured out that when I
hard code the store number criteria as like '%03%' I can get store 3's
information. If I leave it as a [storenum] and enter 03 into the
spreadsheet again I get no rows back. Even when I use equals instead
of like, there's no improvement.

Is there a way to make the spreadsheet pass %03% to the query, or to
make the query make a %[storenum]%. I have a feeling there's more
viability to the first option, as %[storenum]% isn't the right
wildcard.

If you have any ideas or input please respond.

Regards

Ben / ND
 

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