- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sysdate -1 but how about time as well
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2006 09:38 AM
тАО05-09-2006 09:38 AM
How about day plus time?
I need to pull everything > then yesterday at 6 am.
Going even deep, how about between yesterday at 6 am and today at 6 am?
Oracle 10g database.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2006 01:34 PM
тАО05-09-2006 01:34 PM
SolutionYou can try this.
Lest assume your date column is coldt.
Select coldt where coldt > (sysdate -1) and
to_char(coldt,'HHMISS') > '060000';
This will check the house, minute and second component to be grater than 060000, whcih is after 6 AM.
And for todays records between 00:00 hours and 06:00 hours
do the same with coldt = sysdate and to_char(coldt,'HHMISS') between '000000' and '060100';
I hope this helps.
Indira A
to_char(lastupdatedts,'HHMISS') between '070000' and '102000';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2006 06:50 PM
тАО05-10-2006 06:50 PM
Re: sysdate -1 but how about time as well
In fact you can format it any way you want,
see this example
select to_char(sysdate-1,'YYYY-MM-DD:HH24:MI:SS') from dual
or
select to_char(sysdate-1,'HH24:MI:SS MM-DD-YY:') from dual
the formatting is very flexible,
then you can use that in your query
with operators like
greater then > , smaller then <
equals =
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2006 04:18 AM
тАО05-14-2006 04:18 AM
Re: sysdate -1 but how about time as well
That should get you everything from yesterday after 6am system time. Note the 6 in "6/24" can be changed to increase the hours.
(Another quick note, you can use 30/1440 to increase it 30 minutes, etc).
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2006 02:37 PM
тАО05-14-2006 02:37 PM
Re: sysdate -1 but how about time as well
For grins a test done just before 10pm 5/14:
SQL> select trunc(sysdate-1+6/24) from dual;
14-MAY-06
SQL> select trunc(sysdate-1+2/24) from dual;
13-MAY-06
SQL> select trunc(sysdate-1)+2/24 from dual;
13-MAY-06
SQL> select to_char(trunc(sysdate - 1) + 6/24,'HH24:MI:SS MM-DD-YY') from dual;
06:00:00 05-13-06
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2006 12:45 AM
тАО05-15-2006 12:45 AM