ArcGIS url query using date parameter stopped working overnight - arcgis

Until a few days ago, this query ran without problems:
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt>='2022-05-01'&outFields=*&returnGeometry=false&outSR=4326&f=json
Now it returns:
error
code 400
extendedCode -2147220985
message "Unable to complete operation."
details []
The URL without RptDt specification still works just fine:
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=1%3D1&outFields=*&returnGeometry=false&outSR=4326&f=json
Here is a link to the open data portal resource.
The trouble appears to be in this bit: where=RptDt>='2022-05-01'.
Did ArcGIS change the formatting for date values? Does anyone know how I can update my URL to work properly?

If you change the date query to use a standardized date format it seems to work fine, ie using RptDt>=date'2022-05-01' instead of RptDt>='2022-05-01'.
Updated example URL: https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt%3E=date%272022-05-01%27&outFields=*&returnGeometry=false&outSR=4326&f=json

Related

Error message when using UDF and javascript - The project ____ has not enabled BigQuery

In BigQuery console I created a UDF function (language js) and now trying to call it from a saved query. I tried referencing the UDF with projectID.dataset.UDF_Name (same as I am using the for referencing vies/tables). When I click Run in UI I got an error:
"The project XXX has not enabled BigQuery"
I checked the BigQuery API and it says enabled.
When I only used dataset.UDF_Name for reference the query worked but I can save it as view getting another error: Bad routine reference "dataset.UDF_Name()"; routine references in standard SQL views require explicit project IDs
So clearly, the right approach is to use the projectID.dataset.UDF_Name() format but I can't figure out how to get rid of the "The project XXX has not enabled BigQuery" error.
Any help, much appreciated.

Pass large parameters to browser

I created more than 20 reports using crystal report. Now I am integrating them to my API service. One particular report uses the following parameters:
lngCompanyId=1
szITSfromCompany=Sample
strGroupBy=Region
strGroupBy1=Greater Accra
strQuery1='and #tblRetOutletSumm.iRegionID=4'
strQuery2='and #tblRetOutletSumm.iDistrictID=8'
strQuery3='2016-10-27'
strQuery4='2016-10-27'
strPicHeight=1
strPicWeight=1
Now i have to pass them to my web browser to generate the report. I tried the following URL after running the project:
http://localhost:20010/Home/CreateSummaryReport?lngCompanyId=1&szITSfromPersol=Sample&strGroupBy=Region&strGroupBy1=Greater Accra&strQuery1=and #tblRetOutletSumm.iRegionID=4&strQuery2=and #tblRetOutletSumm.iDistrictID=8&strQuery3=2016-10-27&strQuery4=2016-10-27&strPicHeight=1&strPicWeight=1
It broke the code. It passed up to strGroupBy1 which is Greater Accra but when it came to strQuery1, it only showed me the first word which is and instead of and #tblRetOutletSumm.iRegionID=4 and all the remaining parameters threw null values.
I know the '#' tag causes the problem, so how do I pass the parameter? Or should I change a the database procedure?
Changing the '# tag' by ascii symbol solved the issue.
I changed the '#' tag by '%23' and the issue is solved.
Somad

Adwords api report without download

I'm working with Adwords API, I already can download reports like: all keywords with impressions, clics, ctr, conversions, etc...
The problem is, I need to show this report on our web tool when the user set the date range.
Now I'm doing this: The user selects Start Date 01/09/2014 End Date 15/09/2014, I call Adwords Api, download CSV, parsing it, and then show the results on the screen, but this way is not optimal and I would like to know how to call the API and get the results "at the moment", getting an XML or JSON without download a file.
Is it possible??
The only way I found was calling CampaignService class.. getting all campaigns, then for each campaign calling AdgroupService for get all Adgroups, then keywords.... It's really impractical.
How can I do it?
Thank you very much.
It appears in recent versions of the libary they created a function (getAsString()) so we can achieve this:
$reportDownloader = new ReportDownloader($session);
$reportDownloadResult = $reportDownloader->downloadReport($reportDefinition);
//Normal way of downloading to file
//$reportDownloadResult->saveToFile($filePath);
//printf("Report with name '%s' was downloaded to '%s'.\n",
// $reportDefinition->getReportName(), $filePath);
//New way by calling getAsString();
$reportAsString = $reportDownloadResult->getAsString();
echo $reportAsString;
Old suggestions about passing null as the $filePath no longer work.
Yes, you can get XML without downloading file. Just set $path to Null when calling ReportUtils::DownloadReport() and it returns you response without saving it to file.
The AdWords API library (as of v201506) allows you to set the download_format to one of CSVFOREXCEL, CSV, TSV, XML, GZIPPED_CSV, or GZIPPED_XML. It unfortunately does not support JSON, even if you ask to download the report data (not as a file).
$reportAsString = $reportDownloadResult->getAsString();
$xml = simplexml_load_string($reportAsString);

API Client 1.3 (rev89) - Error 500 "No individual errors" when using Fields Filter

Today (10.00 AM GMT+2) the code deployed in a production environment, started throwing an increasing number of errors while requesting file lists from a Google Drive folder, the error was always 500 "No Individual Errors".
After 2 hours, all the request failed.
The code regarding the file list request is the following:
'Search for a specific file name
oListReq.Q = "mimeType = 'application/vnd.google-apps.folder' and title = '" + ParentFolder + "' and trashed=false"
oListReq.Fields = "items/id" 'MSO - 20130621 - only ID is needed
oListReq.MaxResults = 10 'Max 10 files (too many I Expect only 1)
'Get the results
oFileList = oListReq.Fetch()
Testing the same requests with the API Explorer there is no problem and only the ID is returned.
Going step by step trying to identify the problem, turns out that all the requests with the Fields field specified generated a 500 error (other requests in the code have "items(id,alternateLink)" but the result is the same as the code above).
Temporary fixed the code commenting those lines.
Could you please investigate why this filters are not working with the .Net Client Library anymore?
Sorry for that. This error has been reproduced and Google is investigating on this. For now, please turn off fields filter.
It seems the issue is now fixed. We had the same issue with one of our production application, we had to produce a hot fix, but I performed a test a few minutes ago and it looks like it works again.

2 web servers using the same database. One is throwing date out of range error

I am moving a classic asp website from a windows 2k3 server/iis6 environment to windows 2008r2/iis7. A couple of the pages pass the system date to an mssql database and the following error is occuring: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The date being passed is '13/01/2011 hh:mm:ss AM'. I understand that the database is interpretting this as the 13th month and that is why the error.
What I don't understand is where exactly this date is coming from. The page is using this snippet for the date:
FormatDateTime(DATE() & " " & Time(), vbGeneralDate)
This should return a date in the format mm/dd/yyyy but it doesn't seem to. Since web servers are using the same database I figure the problem must be web server specific.
I checked in control panel/regional settings and both are set to US english and the format there appears to be correct. Is the system date & time formats specified anywhere else? I could not find anything in IIS where I could set a default date format
i think you need a Session.LCID(=LCID) line in your code.
more on this:
http://www.w3schools.com/asp/prop_lcid.asp
The problem ended up being the system locale setting found in control panel --> region and language. This setting "controls the language used when displaying text in programs that do not support Unicode."