| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Last Full Three Months?
Dan wrote:
> Hi,
>
> I have sales line item detail like
>
> invoicedate, custid, ordernum
>
> Is there a way using SQL to only return records for the last full three
> months? For example, if today is 2/4/05, I would want records with
> invoicedate between 11/1/04 and 1/31/05.
>
> TIA,
> Dan
It is as simple as a query with a BETWEEN. The trick is determining the exact date figures. This would be very easy in a client language, and PHP for instance makes it child's play. Do you have the option to form the query in the client language, or are you required to make a stored procedure on the server?
-- Kenneth Downs Secure Data Software, Inc. (Ken)nneth@(Sec)ure(Dat)a(.com)Received on Thu Jun 02 2005 - 06:33:40 CDT
![]() |
![]() |