Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> trunc sysdate help please
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
![]() |
![]() |