It worked for me. Thanks Josh !
On Thursday, April 3, 2014 6:35:54 AM UTC-7, Josh Radcliff (AdWords API
Team) wrote:
> Hi Tom,
>
> Below is a sample of how to pass a custom date range.
>
> DateRange dateRange = new DateRange();
> dateRange.setMin("20140101");
> dateRange.setMax("20140131");
> selector.setDateRange(dateRange);
>
> Are you using an IDE such as Eclipse? It would provide you with context
> assistance and let you know the valid constructor calls and data types.
>
> Cheers,
> Josh, AdWords API Team
>
> On Wednesday, April 2, 2014 8:07:21 PM UTC-4, Tom wrote:
>>
>> Hi ,
>>
>> Picking up the old thread...I am using
>>
>> Selector selector = new Selector();
>>
>> SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
>> java.util.Date startdate = formatter.parse("2014-04-01");
>> java.util.Date enddate = formatter.parse("2014-04-02");
>> selector.setDateRange(new DateRange(startdate,enddate));
>>
>> But getting an error :
>>
>> The constructor DateRange(Date, Date) is undefined
>>
>> I am importing com.google.api.ads.adwords.lib.jaxb.v201309.DateRange .
>> So not exactly sure what am I doing wrong.
>>
>> Any help is appriciated.
>>
>>
>>
>>
>>
>> On Tuesday, March 11, 2014 2:10:59 PM UTC-7, Josh Radcliff (AdWords API
>> Team) wrote:
>>
>>> Hi Tom,
>>>
>>> Sorry, I misread the original error. Please remove any imports of
>>> *DateRange* that you currently have and replace them with:
>>>
>>> import com.google.api.ads.adwords.lib.jaxb.v201309.DateRange;
>>>
>>> Thanks,
>>> Josh, AdWords API Team
>>>
>>> On Tuesday, March 11, 2014 2:53:11 PM UTC-4, Tom wrote:
>>>>
>>>> Thanks for the reply Josh !
>>>>
>>>> I imported com.google.api.ads.adwords.axis.v201309.cm.DateRange class
>>>> and getting the below error:
>>>>
>>>>
>>>> The method
>>>> setDateRange(com.google.api.ads.adwords.lib.jaxb.v201309.DateRange) in the
>>>> type Selector is not applicable for the arguments
>>>> (com.google.api.ads.adwords.axis.v201309.cm.DateRange)
>>>>
>>>>
>>>>
>>>>
>>>> On Monday, March 10, 2014 5:33:44 PM UTC-7, Tom wrote:
>>>>
>>>>> Hi ,
>>>>>
>>>>> I am new to adwords. I am trying to use custom date range using JAVA
>>>>> API and I found on forums that date range is a property of a selector and
>>>>> found this about stats objects
>>>>> http://googleadsdeveloper.blogspot.com/2013/10/adwords-api-how-to-migrate-from-stats.html
>>>>> .
>>>>> So I am trying:
>>>>>
>>>>> Calendar cal = Calendar.getInstance();
>>>>> Selector selector = new Selector();
>>>>> String startdate = new
>>>>> SimpleDateFormat("20130101").format(cal.getTime());
>>>>> String enddate = new
>>>>> SimpleDateFormat("20131231").format(cal.getTime());
>>>>> selector.setDateRange(new DateRange(startdate, enddate));
>>>>>
>>>>> but its throwing an error:
>>>>>
>>>>> The method
>>>>> setDateRange(com.google.api.ads.adwords.lib.jaxb.v201309.DateRange) in
>>>>> the
>>>>> type Selector is not applicable for the arguments
>>>>> (com.google.api.ads.adwords.axis.v201306.cm.DateRange)
>>>>>
>>>>> I am using client library version v201309.
>>>>>
>>>>> Please let me know where am I erring.
>>>>>
>>>>> Thanks for help !
>>>>>
>>>>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.