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]
- Awkward SQL James Smith
- Re: Awkward SQL Jochem van Dieten
- Re: Awkward SQL Paul Hastings
- RE: Awkward SQL James Smith
- RE: Awkward SQL James Smith
- Re: Awkward SQL Jochem van Dieten
- RE: Awkward SQL James Smith
- Re: Awkward SQL Jochem van Dieten
- Re: Awkward SQL Jochem van Dieten
- Re: Awkward SQL Claude Schneegans
- RE: Awkward SQL James Smith
- RE: Awkward SQL James Smith