LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel, reference a cell for parameter in SQL to import data

I am using SQL in Microsoft Query to import data from a ODBC data source
into Excel. I am linking mutiple tables from the source and this seems
to prevent from being able to reference a cell in the spreadsheet as a
parameter value. The import works when I 'hard-code' the date in the
code, but I would like to be able to reference a cell in the spreadsheet
so the end user can refresh the data after just changing the date in the
spreadsheet. Here's a portion of my code:

SELECT trim(gltrans.ref), GlTrans.Value
FROM GlTrans INNER JOIN SYSFIL
ON (GlTrans.SUB_ACCT = SYSFIL.DB_SUB_ACCT)
AND (GlTrans.ACCT = SYSFIL.DB_ACCT)
AND (GlTrans.DEPT = SYSFIL.DB_DEPT)
AND (GlTrans.BRANCH = SYSFIL.DB_BRANCH)
AND (GlTrans.COY = SYSFIL.DB_COY)
WHERE GlTrans.Period_Date < '2006-06-01' AND
(SYSFIL.Module_Type='VHS' AND SYSFIL.Acc_des='RT') AND
GlTrans.Year_End_Date =
(SELECT current_year_end_date FROM company WHERE coy = (SELECT db_coy
FROM sysfil WHERE acc_des = 'debtor'));

What I would like to do is replace the '2006-06-01' date with the date
supplied in cell C1 in my spreadsheet. I do have the date formatted
correctly in the cell.

I have searched for resolutions on the Internet, trying several
examples, but have not found the correct resolution yet. Any help is
appreciated.
Brian
Business Analyst
JDIS

*** Sent via Developersdex http://www.developersdex.com ***
 
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
import data from an Access parameter query PluckyMo Excel Discussion (Misc queries) 2 April 12th 06 04:42 AM
Data_field parameter in getpivotdtata as a cell reference. Tomas Excel Discussion (Misc queries) 1 July 22nd 05 03:18 AM
Help to import data from reference workbook JackSpam Excel Discussion (Misc queries) 2 July 20th 05 02:37 AM
Data Import Cell Reference John Excel Programming 6 December 31st 04 08:15 PM
Import Access records to excel (parameter is a called funct) v.20 PSKelligan Excel Programming 18 September 28th 04 03:03 PM


All times are GMT +1. The time now is 03:28 PM.

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

About Us

"It's about Microsoft Excel"