Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I execute this query?


Hi all,

I'm trying to do a query from MS Access to MS excel which have th
condition that the date period has to be on a specific month, and
want to get the sum of the value.
I try to do this, but it didn't work.


Code
-------------------
MyQuery = "SELECT SUM(JOBACTIV.POVALUE) as sum FROM JOBACTIV WHERE JOBACTIV.JOBCLASS = 'S';"
Set rs = db.OpenRecordset(MyQuery)
Cells(1, 1).Value = Su
-------------------


How can I fix this problem?
Note: JOBCLASS is a field in the Access table

Thank you very much

--
wlion
-----------------------------------------------------------------------
wliong's Profile: http://www.excelforum.com/member.php...fo&userid=2834
View this thread: http://www.excelforum.com/showthread.php?threadid=51986

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
Could not execute Gary Excel Worksheet Functions 1 December 20th 04 06:20 PM
Excel VBA Query Using Access Database Hangs on 2nd Execute Mike Knight Excel Programming 7 November 4th 04 05:12 PM
Execute a query from a macro Ken Schmidt Excel Programming 0 June 26th 04 09:59 PM
Macro to execute on WEB Query Refresh Donnie Stone Excel Programming 1 September 30th 03 02:16 PM
Execute a query against an excel doc and a sql server db Rick[_14_] Excel Programming 1 August 30th 03 02:50 PM


All times are GMT +1. The time now is 07:14 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"