Posted by MGFoster on 07/19/05 22:22
wackyphill@yahoo.com wrote:
> Can someone give me a simple example of how to force a datetime value
> to be stripped of the time portion when it is added/updated to a table.
> I intend to use it for date only.
>
> I figured a trigger was the way to do this but haven't gotten the
> syntax right. Can someone please show me how? I've never written a
> trigger before.
Saw this in a --CELKO-- post:
here is a proprietary but fast way to trim off the time:
CAST (FLOOR (CAST (my_date AS FLOAT)) AS DATETIME) = my_date
use CEILING() and you go to the next day.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Navigation:
[Reply to this message]
|