
November 2nd, 2011, 08:03 AM
|
|
Registered User
|
|
Join Date: Nov 2011
Posts: 8
Time spent in forums: 4 h 56 m 58 sec
Reputation Power: 0
|
|
|
Parameter query to give a result if meets requirements
Code:
SELECT Cluster_Owner_Lookup.Cluster_Owner
, Ticket_Data.Number
, Ticket_Data.Asset
, Ticket_Data.Open_Time
, DATEDIFF("d",Ticket_Data.Open_Time,NOW()) AS Age
FROM Ticket_Data
INNER
JOIN Cluster_Owner_Lookup
ON Cluster_Owner_Lookup.Asset = Ticket_Data.Asset
ORDER
BY Cluster_Owner_Lookup.Cluster_Owner;
This is my code so far, its to select Number, Asset, Open Time, calculate the age of a ticket, and also lookup a owner of the ticket based on a lookup table.
What i need it to do now is give me a range of the age so say if the ticket is 310 days old that the result should be >300 in the new column showing all the tickets with their new respective range.
My ranges should be 0-100, 101-200, 201-300, >300.
Would i start with a Like expression?
Btw this is in Microsoft Access right now
|