Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help with date query
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
![]() |
![]() |