Where is the exception thrown? What error message do you get? On Tuesday, June 25, 2013 5:41:15 PM UTC-4, Carl Stone wrote: > > Sorry it didn't work > > Throws a very long exception. > > > On 25 June 2013 21:55, asgallant <[email protected] <javascript:>>wrote: > >> I do not know exactly what the format you want is, but try this and see >> if it works: >> >> var d = new Date(); >> d.setDate(dt.getDate() - 1); >> var year = d.getFullYear(); >> var month = d.getMonth() + 1; >> if (month.toString().length == 1) { >> month = '0' + month; >> } >> var day = d.getDate(); >> if (day.toString().length == 1) { >> day = '0' + day; >> } >> var hour = d.getDate(); >> if (hour.toString().length == 1) { >> hour = '0' + hour; >> } >> var minute = d.getDate(); >> if (minute.toString().length == 1) { >> minute = '0' + minute; >> } >> var second = d.getDate(); >> if (second.toString().length == 1) { >> second = '0' + second; >> } >> var microsecond = d.getDate(); >> while (microsecond.toString().length < 3) { >> microsecond = '0' + microsecond; >> } >> var dateString = year + '-' + month + '-' + day + ' ' + hour + ':' + >> minute + ':' + second + '.' + microsecond; >> >> var query = new google.visualization.Query(' >> https://docs.google.com/a/printpack.com/spreadsheet/ccc?key=keygoeshere' >> ); >> >> query.setQuery("select A,C where A >= datetime " + dateString); >> >> On Tuesday, June 25, 2013 4:35:55 PM UTC-4, Carl Stone wrote: >>> >>> I need a little help >>> >>> Column A has the date and column C has the values, I need to keep the >>> history in the spreadsheet but I am trying to select >>> the previous 24 hours worth of data and present it into a line chart. >>> >>> The date being recorded is in this format '2013-06-25 07:00:00.000' but >>> I'm struggling with my query.setQuery >>> and I feel its a problem with my formatting >>> >>> Can anyone recommend how I can construct my query, the code I'm using is >>> below >>> >>> Thanks >>> >>> Carl >>> >>> var d=new Date(); >>> d.setDate(d.getDate()-1); >>> >>> >>> function drawVisualization() { >>> >>> var query = new google.visua**lization.Query( >>> >>> 'https://docs.google.com/a/**printpack.com/spreadsheet/ccc?**key=<https://docs.google.com/a/printpack.com/spreadsheet/ccc?key=0AtrPmDPohJ6ndGVyMXpJUlJXR0VqcjNpaE1RcEh2VXc#gid=0> >>> keygoeshere'); >>> >>> query.setQuery("select A,C where A >= datetime +d+ "); >>> >>> >>> query.send(handleQueryRespon**se); >>> } >>> >>> function handleQueryResponse(r**esponse) { >>> if (response.isError()) { >>> alert('Error in query: ' + response.getMessage() + ' ' + response. >>> getDetailedMessag**e()); >>> return; >>> } >>> >>> var data = response.getDataT**able(); >>> visualization = new google.v**isualization.LineChart(documen**t. >>> getElementById('**visualization')); >>> var options ={ >>> width: 1500,height: 400 >>> } >>> visualization.draw(data, opt**ions); >>> } >>> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Google Visualization API" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/google-visualization-api/QmOgyp_8UMc/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected] <javascript:>. >> To post to this group, send email to >> [email protected]<javascript:> >> . >> Visit this group at >> http://groups.google.com/group/google-visualization-api. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >
-- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
