Hello Everyone
I'm sure that there is a simple answer to this but I was wondering if
there was an elegant way to change the definition of the functions like
year, month and day such that they are effectively run for a different
time zone without changing the server time/timezone. When you run say:
select day(transaction_time),
count(*)
from transaction
where transaction_time >= current timestamp - 10 days
it will use the current timezone. So if we have two machines one in
London and one in NY and we run the same query on each server we'd get
different results due to NY time being 5 hours behind London time. Or
as in our case we have a single server handling clients in multiple
timezones each of which want to have reports come out in their local
time.
One way to do this is some time arithmetic before passing it on to the
date functions (i.e. day(transaction_time - 5 hours) but that wouldn't
let DB2 use the indexes defined on transaction_time assuming there was
one IIRC.
Has anyone got any ideas how this can be done?
thanks in advance
tim