Query brings in wrong date

D

David

Hi Group,

myurl = "http://finance.google.com/finance/historical?histperiod=daily&q=" _
& sym & "&startdate=" & StartMo & "+" & StartDay & "%2C+" & StartYr &
"&enddate=" _
& StopMo & "+" & StopDay & "%2C+" & StopYr & "&output=csv"

With qt
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

The above query is not bringing in the dates that I expected.
The dates should be between 1/12/2009 and 6/8/2009.
The variables used above are:
StartMo = 1
StartDay = 12
StartYr = 2009
StopMo = 6
StopDay = 8
StopYr = 2009

It brings in 6/18/2009 back to 6/20/2008, about a year.

Not sure how to change url to get this to happen.

Thanks,
David
 
D

David

Hi,
The date is split into variables as indicated below. The query does pull in
data, it is just the wrong dates, and a similar query works with numbers in a
different file.
Thanks for your suggestion.
David
 
D

David

HiMishell,

I do not know if you are interested, but I did find the answer. I had to
format the month of each date "mmm", but I do have to break up the query
still, since it is going in as a variable.

Thanks again for your time and efforts.

:),
David
 
M

Mishell

I am glad you found the answer.

Mishell

David said:
HiMishell,

I do not know if you are interested, but I did find the answer. I had to
format the month of each date "mmm", but I do have to break up the query
still, since it is going in as a variable.

Thanks again for your time and efforts.

:),
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top