Very good point Dimitri.  I am sure there are functions (or one could
write one) to join a date and time to.

One could also do a the sql statment:

    (mydate = '02-01-2002' and mytime > '8:00')
OR  (mydate between '02-02-2002' and '02-04-2002')
OR  (mydate = '02-02-2002' and mytime < '20:00')


So having to do date(mytimestamp) ...

is much less work for where you need the date separate then either of the
alternatives when you need the date and time together.

Brings us back to the (potential) rule of thumb:

If the date and the time are related values, then put them in a timestamp
field.

Terry


On Thu, 28 Feb 2002, Dimitri  Abramov wrote:

> But when you need to output records that were changed between 17-01-02 8:00
> am. and 23-01-02 8:00 pm.  it is easer to say:
>  where datetime between '17-01-02 8:00' and '23-01-02 20:00'
>
> than: ?..
> Is that possible to do the same thing having datetime values separated?
> Obviously query:
>
>  where DATEtime between '02-01-2002'  and '02-05-2002'
>    AND dateTIME between '08:00'  and '20:00'
>
> will not return the same results.
> You probably would have to say something like:
>
> select (DATEtime dateTIME) as DATETIME_Joint
> where DATETIME_Joint between '17-01-02 8:00' and '23-01-02 20:00'
>
> I didn't tested this so I am not sure, or create two queries.
>
>
> Dimitri
>
>
>
> ***************
> Good point Dan, but computed values apply here to, don't they?
>
> Couldn't you do:
>
>  where date(datetime) between '02-01-2002'  and '02-05-2002'
>
> instead of:
>  where datetime between '02-01-2002 00:00'  and '02-05-2002 23:59'
>
> ***************
>
> Of course you can do that.  It is just easier to not have to.
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: [EMAIL PROTECTED]
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: Dimitri  Abramov <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>

-- 
Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: [EMAIL PROTECTED]
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to