从融合表中查询按日期筛选的数据的问题 [英] issue to query data filtered by Date from fusion table

查看:81
本文介绍了从融合表中查询按日期筛选的数据的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个小的JavaScript代码来查询按日期过滤的数据.

I'm trying to write a small javascript code to query data filtered by date.

如果我在浏览器中写下以下句子,则可以获取数据: "http://www.google.com/fusiontables/gvizdata?tq=SELECT日期,Poids自3049883"

If I write the following sentence in my browser, I can get data : "http://www.google.com/fusiontables/gvizdata?tq=SELECT Date, Poids FROM 3049883"

但是如果我写同样的东西,除了我只想要特定日期之后的数据:

but if I write the same thing, except I want only data after a certain date :

"http://www.google.com/fusiontables/gvizdata?tq=SELECT日期,Poids从3049883 WHERE日期> 2/29/12"

"http://www.google.com/fusiontables/gvizdata?tq=SELECT Date, Poids FROM 3049883 WHERE Date > 2/29/12"

通过类似SQL的API, https://developers.google.com/fusiontables /docs/developers_reference#Select ,它应该可以工作

From the SQL-like API, https://developers.google.com/fusiontables/docs/developers_reference#Select, it should work

我得到一个错误,女巫是'internal_error',消息:'无法解析查询'"

I get an error witch is "'internal_error', message:'Could not parse query'"

-Date是我的融合表中的DATETIME格式.

-Date is a DATETIME format in my fusion table.

-我尝试了不同的格式,但是我无法获取数据.

-I've tried different format, but I can not get data.

我在做什么错了?

非常感谢您的帮助.

推荐答案

Date值必须加引号,格式为MM/dd/yy,因此必须用前导零填充数字. 我成功了:

The Date value must be quoted and the format is MM/dd/yy so you must pad single digits with leading zeros. I had success with:

select Date,Poids from 3049883 where Date >= '02/29/12'

注意:我没有使用gvizdata进行测试,只是使用FT JSONP API

Note: I did not test with gvizdata, just with the FT JSONP API

这篇关于从融合表中查询按日期筛选的数据的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆