How to write a query In VBA for Arc Map applications

I have a table with a number of fields and I need to display the data of one field called 'Fdate' which is of type 'Long'

The field 'Fdate' contains data ina a column as follows 19350601,19350602.....

where 1935 is the year and 06 is the month and 01 is the day.So I need to obtain the data from the year 1935 to 2006 for the months of June 01 to Aug 31.So I have written a query but I am getting some errors.

This is the query that I have written:

Dim mydate as String

Dim startyear as String
Dim endyear as String
Dim startmonth as String
Dim endmonth as String
Dim startdate as String
Dim enddate as String

Dim i as Integer
Dim j as Integer
Dim k as Integer

startyear="1935"
endyear="2006"
startmonth="06"
endmonth="08"
startdate="01"
enddate="31"

for i=startyear to endyear
for j=startmonth to endmonth
for k=startday to endday
mydate = i & j & k

Number= CLng(mydate) /*'To convert string to Long as field 'Fdate' is of type long*/
Set pQueryFilter = New QueryFilter
pQueryFilter.WhereClause = "Fdate = " & mydate
Next
Next
Next

Can anyone help me in changing the code to get the required data

Thank You

Krishna

[1434 byte] By [Kris18d] at [2008-1-7]