Re: Date

From: Date: Wed, 22 May 2002 09:09:52 +0000
Subject: Re: Date
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19349@lists.php.net to get a copy of this message
On Wednesday 22 May 2002 16:51, John Fishworld wrote: > Can someone help me with the correct sytax here ! Please state which DB you're using. I assume it's MySQL. > I'm trying to show results from the last two days(or week etc) > > This is what I've got > > SELECT ..... > WHERE..... > AND ( (DATE_SUB(j.stellen.t_stellen_date INTERVAL 2 day) < > j.stellen.t_stellen_date) > > but it doesn't work ! Please state /how/ it doesn't work! > What's wrong ? You're probably missing a comma before INTERVAL, and you're using the wrong formula: AND ((DATE_SUB(NOW(), INTERVAL 2 day) < j.stellen.t_stellen_date) ... > The t_stellen_date field is a date field ! Ok, we can hear you loud and clear, no need for the exclamation marks :) -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Why do they call it baby-SITTING when all you do is run after them? */

« previous php.db (#19349) next »