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

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

If you have any ideas or input please respond.


Ben / ND

nickdangr1 (14)
9/21/2005 4:16:45 PM
excel 39879 articles. 2 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 48


Similar Artilces:

SQL Query in VBS
I am trying to convert some code to VBS. I am simply trying to query an SQL Database to return an integer value and assign it to a variable in my script. the code works perfectly in The problem I am having in VBS appears to be returning the value of the data field. the connection works fine. my test for BOF and EOF does not fail and the logic makes it to my assignment statement. I do not recieve any errors, but it seems whatever I try, the expected data is not assigned and is always null. The SQL query when run by itself through Enterprise Manager, returns...

Typed Dataset as description of XML database?
I have read how one can define tables, indices, relations etc. in .Net code in a way that allows you to run a off-line XML based ADO.NET, which is excactly what I need. I have also read about Typed Dataset and hoiw this definition is stored in an XSD file. I was wondering if these two technologies can be used together or put in other words: Can I use the GUI tools in VS.Net to define the layout of my tables in order to desing my off-line XML database? Thank you in advance. All inputs on the issue is welcome. Best regards, Soeren Hello! > I was wondering if these two technologies...

Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage
Hi, I am some what new to Visual C++ environment, so please forgive any trivial queries made, but do reply. Can an MFC ActiveX control use a C++ DLL internally to process information. The ActiveX DLL here, is provides a GUI component to be embedded on a webpage and also process data which it receives through the DLL (through sockets). How should the DLL be structured so that it can be used by the ActiveX control on the client machine, without actually registering the itself (the ActiveX gets registered by IE, but I don't want the DLLs ActiveX control uses to get registered)? I have cre...

Editing multiple cells with one action????
I have created many IF statements running down the page. To fill dow the page I added $ to the cell that I wanted to remain constant but no I want to fil across so I have to change the $ to a different cel reference in the IF statement. To avoid changing each individual IF statement (there are quite a few I was wondering if there was a way I could highlight all of the cell and just make the change in one which will change all of th highlighted cells. Please help, thanks. = -- Pedro ----------------------------------------------------------------------- Pedros's Profile: http://www.ex...

need query to random update field with 0,1,2,3 or 4
Hi, I need to update a field with a random number 0 1 2 3 or 4 in order to test a report. Can anyone set me up with a query for this? There is no criteria to update from, it should update all records in the table. Thanks, Robbie On Tue, 7 Aug 2007 12:06:30 -0700, "Rob" <> wrote: >Hi, I need to update a field with a random number 0 1 2 3 or 4 in order to >test a report. Can anyone set me up with a query for this? There is no >criteria to update from, it should update all records in the table. > >Thanks, >Robbie > UPDATE yourtable SE...

Count using Multiple Criteria
I have a spered sheet I am using to keep track of leaks of different types and it covers several years. I would like a tally sheet by year. This requires that I use the year column and the leak type column in my search criteria. Date Unit Type Of Leak Location 12/00/02 1811 Slab Hot water line to washing machine 11/00/02 1515 Grout Grout around bath tub 11/00/02 16th Stack Pin hole Main shutoff leaking 10/00/02 Pump Room Pin hole 2 1/2 supply line to pump 10/00/02 109 Plumbing Patio hosebib supply 9/00/02 10th Floor Plumbing Across from the South Planter 8/00/02 1216 Plumbing repairs I...

Using a Pivot table in a form
I have created a pivot table that displays exactly what I want to see. Is there a way to display that results inside a form? ...

Is there any way to use gridlines in the Excel Calendar Templates?

How can IIS access the database without having ASPNET account in the database
Hello! I have a CustomerData.aspx with two controls one SqlDataSource and one DataGrid that is listing every Customer in the Northwind traders database. I run the CustomerData from visual studio 2005 using the build in Development Server so I use the File system. This works perfect To make it work from IIS I created a virtual directory that points the the physical path where my web site is located. Now to the strange thing I just tried to run this page http://localhost/Northwind/customerdata.aspx from the brower and it worked without having added any account for ASPNET in Sql...

Callout and DataBase Access
Hey I am trying to access the database from within the CRMCallout , but I am getting an error SQLException timeout (server not responding) Please do help . Has anyone worked with database access from callout. Please do send code. regards nina Hi, I have experienced similar problems when using post-callouts, at least for some entities... It seems that MSCRM locks the database while the post-callout process is running. You can solve this using one of two methods: 1) Create a post-callout that only writes a message in MSMQ. Create a process that pools the queue and dose whatever you want ...

Tab key doesn't move cell by cell moves across the sheet one page at a time. Where can I change the setting back to how it used to be? Many thanks, Mark Mark Try Tools / Options / Transition / and uncheck Transition Navigation Keys. Andy. "Mark Ambrose" <> wrote in message news:c27bh9$ > moves across the sheet one page at a time. > > Where can I change the setting back to how it used to be? > > Many thanks, > > Mark > > "Andy B" <> wrote in message news:eC3ZO...

counting total cells with text
Hi , I have a column with text and blanks and I am trying to count the total number of cells with text. I searched through this site and found something with COUNTA() - COUNT() but this doesn't work because I have no numerical values. Any ideas are sincerely appreciated Thank you -- peace ------------------------------------------------------------------------ peace's Profile: View this thread: One way =ROWS(A1:A20)-COUNTBLANK(A1:A20) -- bill k -...

Pivot Table / Format cells
I am setting up a pivot table at the moment, and part of my source dat is formatted at percentage. In the pivot table it shows the data as 0. instead of 60%. I found out how to format the cell, by rightclicking it and going t select, enable selection, and then format / percentage. It now show 60% My problem is that I have a pull down menu at the top, with 100 names And when I choose the name Andy for example, and format the cell a percentage, it works, but as soon as I choose another name, for exampl ben, the fild is unformatted again, eg shows 0.6. Surely I don't have to go through th...

Merged cells when exporting reports into excel files
The excel files exported by custom reports we have made using reporting services, have a lot of merged cells. Do you have any idea why does this happen ??? Hi George, We have experienced this before and would like to share our findings Check your report to see if you have any labels added to the report... Generally Report Headings that are wide enough to extend the width of the columns below... Fix is to get to the width of the label to be equal to the width of the entire column being merged. So say you find column D and E merged. Extend the report header label to have a width wide e...

Review Created Database
I have put together my database using 26 tables and I would like for an expert to review my relationships. The entire relationship model is centered on the project number. Basically, all the tables need to link to a specific project number. Would someone be willing to review the database and provide your expert advice? I can send the database to your email account. Please let me know. Stephen On Mon, 23 Nov 2009 06:33:06 -0800, swlaw <> wrote: >I have put together my database using 26 tables and I would like for an >expert to revi...

Select query help
I have tblLog. It's fields are: Call: text Freq: single Mode: text CID: text QSL_R: text Credited: T/F I need the SQL to return all records where 'Credited' is false, 'QSL_R' <> NULL or blank, and whose combination of 'Freq' and 'Mode' for a given 'CID' have 'Credited' = false, but not if that record has a 'mate' whose 'CID', 'Freq/Mode', 'QSL_R' all match, and 'Credited' is True. I'm not sure if my description is understandable, so here is an example. Call Freq Mode...

Query to unnormalize some data
I have a the table with fields [FamNo], [SeqNo], [Name]. It is normalized. I want to select out [SeqNo]= 1 or 2 (easy enough), and create two new variables [NewName1] and [NewName2], so each record has both the 1 and 2 Names. Any ideas? And if this matters, the query needs to be based on a 2 linked tables (on FamNo). On Wed, 17 Mar 2010 20:53:39 -0400, "Joseph Greenberg" <> wrote: >I have a the table with fields [FamNo], [SeqNo], [Name]. It is normalized. I >want to select out [SeqNo]= 1 or 2 (easy enough), and create two new >...

Every Other Cell/Row
I had to copy/paste some data into a worksheet. Unfortunately the data placed a cell in between each/every cell. For example, A1, A3, A5 all have data. A2, A4, A6 all have nothing in them. I want to remove the extra cells/rows WITHOUT having to highlight each cell/row and delete. And using the alphabet search doesnt do me any good as it messes up my order for the data. Any ideas? With range A1:A6 selected (assuming 6 rows) . On the Edit menu, click Go To. Click the Special button. In the Go To Special dialog box, click Blanks. Next, on the Edit menu, click Delete. Select the Delete ...

using money's budget
i have sat here for two hour trying to create a budget for a small home owners assoc. i know all my catagories and how much i'll be paying them in the next year. i don't need my check register to do it. but i can't find where to change the date to tell money what account to look in and for how far back. the catagories i use in my check book don't seem to be the same as while doing my budget. its very frustrating and am tempted tp just use word! I am having similar problem. I set up credit card accounts with scheduled monthley payments in the manage bills and deposits...

Deleting demo data from database?
MS Small Business Server MS CRM 1.2 SQL 2000 I want to delet all demo data from my database and want to enter new data in the database. How can i do this? Awan There is no easy way to do this. You can try deleting records manually via the UI, but if you have a alot of data, this will take awhile. Another, though unsupported, approach would be to set the DeleteionStateCode field in every table to 2. This will allow the deletion service to remove the records. Or, you can try manually deleting from each of the tables (again, unsupported). Just be careful not to delete records from the CR...

Format cell to change seconds to mm:ss
I am working with data that shows time as a numeric in seconds. (ex. 5'50" shows as 350) I need this to show as mm:ss (ex. above 5:50) The mm:ss format does not do this. How can I do this? Hi try the following in an adjancet column (lets say B) enter the formula in B1: =TIME(0,0,A1) format this cell as time and copy this down After doing this you can copy the formula results and paste them as values ('Edit - Paste Specials - Values') -- Regards Frank Kabel Frankfurt, Germany "Larry White" <> schrieb im Newsbeitrag news:13...

#Value! Error when Concatenating
I am trying to concatenate two fields together. They are both numerical fields. I have never had a problem but for some reason some will work but most give me the #Value! error. I am using the 2003 version of Excel. Does anyone know why this is happening? There are no formulas in these two cells. I tried +C13&D14 and I also tried =concatenate(C13,D14) and even =concatenate(C13&D14) but I keep getting the #Value! error. Thanks Lyma, Did you try =C13&D14 ? What are in C13 and D14? Formulas? Beege "LymaBeane" <> wrote in message news:11...

Concatenate Field for Report/Query
I have a table with just Authors that has a relationship to the Title table. In most instances there is more than one author per title. When running a query/report that lists "Title -- Author" I get: Book 1 -- John Smith Book 1 -- Jane Doe Book 1 -- John Gray Book 2 -- Mary Poppins Book 2 -- Dick White I would like the report to say: Book 1 -- John Smith, Jane Doe, John Gray Book 2 -- Mary Poppins, Dick White Can you concatenate only one field like the Author field? If so how do you do it, what's the code, and do you put the code in the query or in the report? See whether ...

I was thinking that putting a button on a dialog box with an ID of IDHELP would automatically cause clicking that button to behave as if the user pressed F1. But I have such a button that does nothing. Did I miss an important step? Thanks. -- Jonathan Wood SoftCircuits Programming ...

auto color fill cells
how do I have cells auto background fill to a certain color when I enter texted into them?...... I don't want to have to do it one by one, nor do I want the whole colum to be that color, just the cells when I enter text into them, is that possible? Format=>Conditional format Cell Value is Not Equal To "" -- Regards, Tom Ogilvy "Chopper" <> wrote in message > how do I have cells auto background fill to a certain color when I enter > texted into them?.....