Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default SQL Query with constraint in a cell

Excel 2007: I am pulling data from an external source (Data ribbon, From
Other Sources, From SQL Server) using a query:

Select * from Transactions where TransType = 'NEW'

I'd like to put the value of TransType in a cell, so I can change the value
in the workbook, <Refresh ALL, and the query runs with a different
constraint.

Is this possible? How do I pass the value of a cell to the query? I prefer
to NOT use VB, a form, or a macro.

Thanks! in advance.

--Dan

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default SQL Query with constraint in a cell

Hi,

I don't think there is any way to do that without VBA.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Dan" wrote:

Excel 2007: I am pulling data from an external source (Data ribbon, From
Other Sources, From SQL Server) using a query:

Select * from Transactions where TransType = 'NEW'

I'd like to put the value of TransType in a cell, so I can change the value
in the workbook, <Refresh ALL, and the query runs with a different
constraint.

Is this possible? How do I pass the value of a cell to the query? I prefer
to NOT use VB, a form, or a macro.

Thanks! in advance.

--Dan

  #3   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default SQL Query with constraint in a cell

OK. So... if I need VBA, where would I go to find an example?
The worksheet is reporting on today's transactions, dashboard-like. The
cell would contain a Julian date of the form 'nnn'.

The transactions have an eleven digit transaction number, of the form
'2009xxxyyyy', whe
xxx = The Julian date (e.g. March 10 would be '069'
yyyy = a sequential transaction number (e.g. '0001', '0002', ...)

The query would be of the form:
-----
select TransactionNumber, AgentName, TransactionTime, RequestClass,
RequestType, ...

from WorkingDatabase
where substring(TransactionType,1,7) = '2009069'
------
'069' would be in the cell. Let's say... cell A1 on Sheet1.
TransactionNumber is a text field.

Thanks for the help.

--Dan

"Shane Devenshire" wrote:

Hi,

I don't think there is any way to do that without VBA.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Dan" wrote:

Excel 2007: I am pulling data from an external source (Data ribbon, From
Other Sources, From SQL Server) using a query:

Select * from Transactions where TransType = 'NEW'

I'd like to put the value of TransType in a cell, so I can change the value
in the workbook, <Refresh ALL, and the query runs with a different
constraint.

Is this possible? How do I pass the value of a cell to the query? I prefer
to NOT use VB, a form, or a macro.

Thanks! in advance.

--Dan

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Constraint - "Solver: tikchye_oldLearner57 Excel Discussion (Misc queries) 2 August 14th 06 06:37 AM
Adding a constraint. AhmtDY Excel Discussion (Misc queries) 2 May 6th 05 09:59 AM
cell value constraint Balder Excel Discussion (Misc queries) 2 April 18th 05 07:14 PM
solver constraint jojo Excel Worksheet Functions 0 February 17th 05 10:11 PM
Definition of integer constraint kimber New Users to Excel 1 January 12th 05 08:22 PM


All times are GMT +1. The time now is 02:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"