Problems in Sql using Google Api

Asked

Viewed 18 times

2

Before asking this question I looked here and did not find the same problem. I use the Google Spreadsheet as my Database and use the sheetrock + sql library to access the spreadsheet. I can return the data but something happens in particular.

I have the following records in the table:

id       Ano    mês      Data
1448    2018    maio    24/05/2018
1449    2018    maio    29/05/2018
1450    2018    maio    29/05/2018
1451    2018    maio    29/05/2018
1452    2018    maio    29/05/2018
1453    2018    junho   05/06/2018
1454    2018    junho   05/06/2018
1455    2018    junho   05/06/2018
1456    2018    junho   05/06/2018
1457    2018    junho   05/06/2018

I need all current month (ex: June) and current year (ex: 2018) records. I use the following SQL

var sqla = 'select * where  B = "' + [variável que pega o ano] +  '"' + ' and  E = "' +   [variável que pega o mês]  + '" order by A DESC ' ;

But when I use order by A DESC it does not return the last record with id 1457. If I withdraw the Order by it returns all the records. But, I need you to return the data in descending order.

What could be my mistake?? Can anyone help me?

  • Which column would A be?

  • 'A' would refer to first column ID

  • Set select as the values of the variables, it can be your Where

  • I’ve done this test and returns the same problem.

  • You’ve taken off the Where and you’re still the same?

  • When I withdraw Where returns all the records. If I withdraw the 'Order by A DESC' returns all the records. But using Order by ASC it returns all the records.

  • Problem solved. My spreadsheet has more than 70 columns. So when I use Select * it doesn’t work. But if I put all the columns sql returns all the record I want.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.