Re: Problem with SQL TODAY
Posted in 1996
Chaiw Kok Kee wrote:
>
> I wonder if anybody can help me. I'm running ESQL-C on a client access
> Informix On-Line 5.07 on another Unix Server. The following SQL, whether in
> ESQL-C or DBACCESS returns yesterday instead of the system date.
>
> $select inv_date
> into $jdate
> where inv_date = TODAY;
>
> Running Query Language using dbaccess has the same problem but running isql on
> the server (where the database resides) yields the correct result. I think
> there might be a problem with inet.
>
> I would appreciate if anybody can share there experience.
ckk,
it's been my experience that one should not trust a client to provide
the correct date or time - especially if the client is dos-windows
based. you can extract the server's date/time info by using the
following sql:
select current
from systables
where tabid = 1
i only mention this as i too got pinged on this during testing. we were
using the client time info to update a last update column. a smart user
(if one can be found) could exploit this to cover his/her !#@. cheers!
-jason