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 -> trunc sysdate help please

trunc sysdate help please

From: Steve <hunt.s_at_blueyonder.co.uk>
Date: Tue, 5 Nov 2002 07:05:49 -0000
Message-ID: <B0Kx9.7817$xF.1535@news-binary.blueyonder.co.uk>


I am trying to trunc sysdate in the following code but keep getting errors. Obviously I am using the wrong syntax or the like. Could someone please give me some guidance on this. I need to do this to force the date and believe that this is the way to do it.

SET PAUSE ON;
SPOOL Steve.lst

SELECT Music.TypeCode, COUNT(LineId) Number_Of_Hires FROM HireContracts,HireContractLines,Music WHERE HireContractLines.ContractId=HireContracts.ContractId AND HireContractLines.MusicId=Music.MusicId AND HireStart BETWEEN LAST_DAY(ADD_MONTHS(SYSDATE),-3))+1 AND LAST_DAY(ADD_MONTHS(SYSDATE),-1))
GROUP BY Music.TypeCode;

SPOOL OFF; Thanks in advance

Steve

Mailto: Hunt.s_at_blueyonder.co.uk Received on Tue Nov 05 2002 - 01:05:49 CST

Original text of this message

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