Finally...

After much messing about I finally got a modified version of Jochem's
solution working...

Jochem's original:
  SELECT CAST(your_datetime_field + INTERVAL '11 hours' AS DATE) FROM table

Working:
  SELECT CAST((your_datetime_field + INTERVAL 9 HOUR) AS DATE) FROM table

Note the extra parenthesis around the "MessageDate + INTERVAL 9 HOUR" and
the removed quotes around the time interval.

I have also dropped it to 9 hours as the cut off is 3pm not 13:00 but that
was the least of my troubles!

Thanks go to Jochem and all others.

--
Jay

> -----Original Message-----
> From: Claude Schneegans [mailto:[EMAIL PROTECTED]
> Sent: 03 September 2004 12:17
> To: CF-Talk
> Subject: Re: Awkward SQL
>
> >>Now I can do this by looping over a query and stinking the
> values into
> >>an
> array but is it possible to do this directly in the SQL?
>
> My feeling is that it would probabily be rather difficult with MySQL.
> I would do it in a loop in CF.
>
> --
> _______________________________________
> REUSE CODE! Use custom tags;
> See http://www.contentbox.com/claude/customtags/tagstore.cfm
> (Please send any spam to this address:
> [EMAIL PROTECTED]) Thanks.
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to