Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

Looking for help Storing/retriving dates in SQLite

$
0
0

Hi Guys,

 

I need to save and retrieve dates in a SQLite Database.

 

Im saving the dates lige this:

 

var mydate = "STRFTIME('%J','"+year+"-"+month+"-"+day+"')"

sqlquery("INSERT INTO gamedata ( leftTime, number, totalTime, usedTime, theDate)" + "VALUES ('"+setValueMaxSpendPerDay+"', '1', '"+setValueMaxSpendPerDay+"', '0', "+mydate+")");


Which seem to be working.

 

How ever when i need to select a specific date at a later stage im not having any luck :-/

 

Im trying this:

var day= "01";

 

var month= "06";

 

var year= "2014";

    var mydate = "STRFTIME('%J','"+year+"-"+month+"-"+day+"')"

 

  sqlquery("SELECT * FROM gamedata WHERE theDate == "+mydate);

 

 

 

I have also tried:

sqlquery("SELECT * FROM gamedata WHERE theDate == "+"'2014-06-01'");

 

But without any luck :-/

 

Any help is greatly appriciated.

 

Thanx in advance

 

Henry


Viewing all articles
Browse latest Browse all 2954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>