Drew,
Nested selects are possible. The syntax for a very simple select statement
of that type would be..
select * from table where field = (select that same field from whatever
table)
But why would you want a nested select for what you want to do? A non nested
select would work with the following statement design..
select * from table where Hours > lower limit and Hours < higher limit and
the 3 month condition....
To extract the 'Hours' part of C3 (Create Date) to a number format, this
should work (please correct the start and end number of the string if I got
it wrong here):
To_Number(SubStr(To_Char(To_Date('01-JAN-1970 00:00:00', 'DD.MM.YYYY
HH24:Mi:Ss') + C3/86400,'DD.MM.YYYY HH24:Mi:ss'), 13,2))
So your statement for the hours part if you want between 8:00 AM to 5:00 PM
would be:
select * from table where To_Number(SubStr(To_Char(To_Date('01-JAN-1970
00:00:00', 'DD.MM.YYYY HH24:Mi:Ss') + C3/86400,'DD.MM.YYYY HH24:Mi:ss'),
13,2)) >= 8 and To_Number(SubStr(To_Char(To_Date('01-JAN-1970 00:00:00',
'DD.MM.YYYY HH24:Mi:Ss') + C3/86400,'DD.MM.YYYY HH24:Mi:ss'), 13,2)) <= 17;
Using the above logic you could extend the where criteria to fit in your 3
month condition..
Hope this helps..
Cheers
Joe
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]]on Behalf Of Drew Shuller
Sent: Tuesday, July 06, 2010 4:17 PM
To: [email protected]
Subject: Date/Time field query
Hello all, is there a way to do a select statement from within a select
statement on field ID 3? I have users that want to know if they created
tickets after a certain hour of the day, for a three month period. Any
ideas? Thank you.
--
Drew
Soto Cano AB
Comayagua, Honduras
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"