----- Original Message ----- From: "Lloyd thomas" <[EMAIL PROTECTED]> To: "Kurt Welgehausen" <[EMAIL PROTECTED]> Sent: Saturday, February 28, 2004 8:34 PM Subject: Re: [sqlite] time calculations
> Thanks Kurt, > Nearly there, but not quite. In the datetime string I have, > it relies on having the seconds as well. ie. '2003-12-04 16:41:00' instead > of '2003-12-04 16:41'. is there a way round this. > ----- Original Message ----- > From: "Kurt Welgehausen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, February 28, 2004 7:14 PM > Subject: Re: [sqlite] time calculations > > > > > > >> SELECT TIME_TO_SEC(duration)as duration > > >> FROM call_data where call_time <= '2003-12-04 16:41' > > >> AND DATE_SUB('2003-12-04 16:41', INTERVAL duration HOUR_SECOND) <= > call_time > > > > Try > > SELECT round((julianday(duration)-julianday('00:00:00')) * 86400) as > duration > > FROM call_data where call_time <= '2003-12-04 16:41' > > AND julianday('2003-12-04 16:41')-duration/86400.0 <= > julianday(call_time) > > > > I haven't tested it, but it's a start. > > > > See also http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions > > > > Regards > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]