Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help with date query

Help with date query

From: Problematic coder <gnewsham_at_gmail.com>
Date: 7 May 2007 16:27:35 -0700
Message-ID: <1178580455.791368.237220@y5g2000hsa.googlegroups.com>


I am trying to write a query that will bring back a result set for the last business day before the query was run

I decided it would be fine to select .... where entry_date = max(entry_date) since there will always be entries on every business day, the only problem with this is if this query is run today after an entry has already been made today, then it will return a result set for today and not the last business day. If we worked everyday it would be easy to do: where entry_date = (sysdate - 1) but since we do not work weekends or holidays this would not work

It seems like I need to write something like this sudo code but I am not sure how

select * from mytable where entry_date is the max entry_date other than sysdate

This will be embedded within an application which will not take user input so a date cannot be provided.

Any thoughts?

Thanks Received on Mon May 07 2007 - 18:27:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US