Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Date minus 90 days sql query problem

Status
Not open for further replies.

marabou

IS-IT--Management
Jan 12, 2001
86
GB
I have aproblem with a sql query I am using through Toad. The db id Oracle 8i and I need to find the number of licences that have startdates from and including the current date to and including 90 days ago. I have spent ages on this and it is obvious that I am missing something stupid. Here is my query


SELECT count (licences.LICENCEID)
FROM licences,
WHERE (LICENCES.STARTDATE <= (SYSDATE)) AND
(LICENCES.STARTDATE >= (SYSDATE) - (90))

I would really appreciate anybodys help on this. Its driving me up the wall.

Thanks in advance
 
Its OK, I moved the brackets around.

Thanks anyway.

Here is my query if anyone wants to know.

SELECT count (licences.LICENCEID)

FROM licences, product_codes

WHERE (LICENCES.STARTDATE <= (SYSDATE)) AND

(LICENCES.STARTDATE >= (SYSDATE - (90)))
 
Thank-you for following up and posting the solution!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top