I'm having trouble with my SQLite Select called from a bash script. I'm trying to get a single value from myDB.db and store it to the variable "result".
result=
sqlite3 /media/0CBA-1996/logfiles/SQLite3Database/myDB.db "SELECT energy FROM SmartMeter WHERE Timestamp= date('now') LIMIT 1";echo $result
The problem seems to be with the quotations cause when I leave out "WHERE Timestamp= date('now')" I get a return from the database.
Any ideas ? Thanks Mick
select date('now')would also fail.