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: 1
Default How can I modify the SELECT statement?


Hi,

I'm trying to query data from MS access 97. Is there any way that I can
add the WHERE condition such that the query is executed on a certain
input date. The Access table has the start date in it, and I want the
query to run on any time frame, for example (I want to get the sum of
POVALUE from February 1, 2006 until March 3, 2006). How can I do this
or what should I modify from the code below?

Thank you so much.



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


--
wliong
------------------------------------------------------------------------
wliong's Profile: http://www.excelforum.com/member.php...o&userid=28343
View this thread: http://www.excelforum.com/showthread...hreadid=519883

 
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
If Statement to select a letter Karl Excel Worksheet Functions 3 February 8th 08 04:01 PM
Trouble with select statement James W.[_2_] Excel Programming 0 May 19th 05 06:04 PM
SELECT statement Tom Ogilvy Excel Programming 2 July 23rd 04 06:24 PM
Adding SQL Select Statement Pepe[_2_] Excel Programming 1 January 29th 04 02:19 AM
Best Way to Modify current IF() statement?????? WebWizard97 Excel Programming 4 September 23rd 03 07:50 PM


All times are GMT +1. The time now is 11:15 AM.

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"