Hi Igor, 20657220 is number of minutes in GMT time zone. So we need to convert to second by 20657220 *60. select datetime(20657220*60, 'unixepoch','localtime' ); will be 2009-04-11 00:00:00 Thanks for the hlep Igor JP
________________________________ From: Igor Tandetnik <itandet...@mvps.org> To: sqlite-users@sqlite.org Sent: Wednesday, April 15, 2009 9:17:09 PM Subject: Re: [sqlite] Need help with the SQL statement. "Joanne Pham" <joannekp...@yahoo.com> wrote in message news:872428.4795...@web90308.mail.mud.yahoo.com > But the first row (20657220 1 2 101 -- this is 2009-04-11 00:00:00) > may not be there in the dailyDataTable so min(startTime) won't work > in this case. Any idea Igor? I don't quite see how 20657220 can represent midnight (of any day) when it's not a multiple of 24*60=1440. What epoch are you counting from? This: select datetime(20657220*60, 'unixepoch'); produces 2009-04-11 07:00:00 for me. Normally, I'd expect something like "startTime / 1440 * 1440" to work (this simply rounds down to nearest multiple of 1440). But I guess I don't understand your time representation conventions. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users