Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Excel from Access

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
I originally posted this in MS Office forum, but it is probably more relevant here.

******

I'm trying to use this query to update an excel sheet from access. Runs fine in Access; however, I get this error when trying to close out in Query Editor and return the results to Excel:

Cannot add the table '((tSubscribers'.

Any ideas?

Code:
SELECT 
s.s_id AS [id], 
'AL' & cStr(s.s_id)&'-'&cDbl(s.s_ts) AS Account,
TRIM(Left(s.s_name,InStr(s.s_name,",")-1)) AS [LN],
TRIM(RIGHT(s.s_name,LEN(s.s_name)-InStr(s.s_name,","))) AS [FN],
s.s_name AS [Subscriber Name], 
s.s_email AS [Email], 
sa.sa_unitnumber AS [Shipping Unit], 
sa.sa_streetnumber AS [Shipping Street Number], 
sa.sa_name AS [Shipping Name], 
sa.sa_street AS [Shipping Street], 
sa.sa_city AS [Shipping City], 
sa.sa_prov AS [Shipping Province/State], 
sa.sa_code AS [Shipping PC/Zip], 
sa.sa_country AS [Shipping Country], 
sa.sa_homephone AS [Shipping Home Phone], 
sa.sa_workphone AS [Shipping Work Phone], 
sl.sl_liability AS Liability, 
sl.sl_holddate AS [Hold Date], 
sl.sl_resumedate AS [Resume Date], 
t.t_currency AS [Currency], 
tSalesPrograms.sp_name AS [Sales Offer], 
ba.ba_unitnumber AS [Billing Unit], 
ba.ba_streetnumber AS [Billing Street Number], 
ba.ba_street AS [Billing Street], 
ba.ba_city AS [Billing City], 
ba.ba_prov AS [Billing Province], 
ba.ba_code AS [Billing PC/Zip], 
ba.ba_country AS [Billing Country], 
ba.ba_homephone AS [Billing Home Phone], 
ba.ba_workphone AS [Billing Work Phone], 
t.t_type AS [Transaction Type], 
t.t_ccnumber AS [CC Number], 
t.t_ccexpiry AS [CC Exp], 
t.t_cctype AS [CC Type], 
t.t_ccname AS [CC Name], 
t.t_chequenumber AS [Cheque Number], 
t.t_nettotal AS [Net Price], 
t.t_taxone AS [PST], 
t.t_taxtwo AS [GST], 
tSubscriberNotes.sn_notes AS [Notes]
FROM 
((tSubscribers AS s INNER JOIN tBillingAddress AS ba ON s.s_id = ba.s_id) 
INNER JOIN ((tShippingAddress AS sa 
INNER JOIN (tSubscriberLiability AS sl 
INNER JOIN tTransactions t ON sl.t_id = t.t_id) ON sa.sa_id = t.sa_id) 
INNER JOIN (tSalesPrograms 
INNER JOIN tIndex ON tSalesPrograms.sp_id = tIndex.sp_id) ON (t.t_id = tIndex.t_id) AND 
(t.t_id = tIndex.t_id) AND (sl.sl_id = tIndex.sl_id)) ON (s.s_id = t.s_id) 
AND (s.s_id = t.s_id) AND (s.s_id = sl.s_id) AND (s.s_id = sa.s_id) 
AND (s.s_id = tIndex.s_id)) 
LEFT JOIN tSubscriberNotes ON s.s_id = tSubscriberNotes.s_id;
 
Ignore this. Somone is trying to help in thread68-1180925
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top