Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATE or is it DAY?

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hello,
I am extremely new to Informix, so forgive me if my question is the most stupid one you people have had for a long time.
I am looking for a way to write 'yesterday'.
Suppose I have this querry: select * from TABLE where row_date='yesterday'. How do I write 'yesterday? I have tried DAY-1, DATE-1 but that does not work. Can someody point me in the right direction?
 
Try:

select whatever
from table
where datumsfeld=today-1;
 
Superb! Thanks, that helped.
 
Is there also a similar command for 'last month' ? Something like 'thismonth-1' ?
 
Bis:

Yes. Use the internal Informix month function. This command:

select * from table where month(datumsfeld) = 3

gets all data from 'table' where the 'datumsfeld' date column is march. There's also corresponding day and year functions.

Regards,

Ed
Schaefer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top