Using Or with Where statement

30 views
Skip to first unread message

Ns sh

unread,
Nov 16, 2018, 11:05:02 AM11/16/18
to AdWords API and Google Ads API Forum

Could you please help me to correct this statement:

.Where("Impressions" Or "Clicks" Or "Conversions").GreaterThan(0)

I go an error "'Conversion from string "Impressions" to type 'Long' is not valid'".

Thanks.

Dannison Yao (AdWords API Team)

unread,
Nov 16, 2018, 1:43:03 PM11/16/18
to AdWords API and Google Ads API Forum
Hi,

The ImpressionsClicks, and Conversions field only accept Long data types. Could you try casting the value "0" into a Long data type?

Let me know if this helps.

Regards,
Dannison
AdWords API Team

Ns sh

unread,
Nov 19, 2018, 3:11:18 AM11/19/18
to AdWords API and Google Ads API Forum
Hi Dannison,
I still have the same error after conversion:
Where("Impressions" Or "Clicks" Or "Conversions" Or "AllConversions").GreaterThan(CLng(0))

Dannison Yao (AdWords API Team)

unread,
Nov 19, 2018, 10:52:51 AM11/19/18
to AdWords API and Google Ads API Forum
Hi,

My apologies for missing this out in my previous response. It appears that you are using an OR operator, this is not supported in the AWQL. You may refer to this guide for further details.

Regards,
Dannison
AdWords API Team

Ns sh

unread,
Nov 20, 2018, 4:31:19 AM11/20/18
to AdWords API and Google Ads API Forum
Cloud you please help me about using something instead of  'Or' to get my query like :  if Impressions> 0 or Clicks >0 or Conversions>0

Dannison Yao (AdWords API Team)

unread,
Nov 20, 2018, 11:07:28 AM11/20/18
to adwor...@googlegroups.com
Hi,

Logically speaking, you may omit the conditions Clicks > 0 and Conversions > 0 because once an impression has been generated, it means that there is also a Click or a Conversion generated. With this said, you may retain the Impressions > 0 only in your condition and it would still retrieve the same result.

Regards,
Dannison
AdWords API Team

Reply all
Reply to author
Forward
0 new messages