I have 2 questions:

  1. I want to compare a field whose data type is "Date" against a given date. The DB is oracle and being a mysql guy I'm finding it difficult to come up with simple queries.

The field("date_closed") stores date in UTC format (24-Aug-2011 18:55:11 for example) and I want to convert it to PST for comparison

I tried this query but it returns some extra rows in the data set(obviously):

select * from table1 where trunc(date_closed)=to_date('2011-08-24','yyyy-mm-dd')

How do I covert to PST format before comparison?

2.In the same query how do I compare "date_closed" against the current date?

link|improve this question

71% accept rate
should be asked on Stack Overflow – Sathya Aug 25 '11 at 5:25
feedback

closed as off topic by Sathya Aug 25 '11 at 5:24

Questions on Super User are expected to generally relate to computer software or computer hardware, within the scope defined in the faq.

Browse other questions tagged or ask your own question.