James Smith wrote:

> I have a query I need which is nothing short of awkward.  I have a field
> which is a date/time type storing data as a full date/time i.e.: "2004-09-03
> 10:37"
>
> I need to select them so that the value returned is "2004-09-03 00:00" but
> more than this I need 3pm to be the date change.
>
> For example.
>
> 2004-09-03 08:00 --> 2004-09-03 00:00
> 2004-09-03 14:00 --> 2004-09-03 00:00
> 2004-09-03 15:01 --> 2004-09-04 00:00
>
> 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?

SELECT CAST(your_datetime_field + INTERVAL '11 hours' AS DATE)
FROM table

Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to