Results 1 to 8 of 8
-
03-28-2012, 03:02 AM #1Newcomer
- Join Date
- Aug 2011
- Posts
- 10
- Thanks
- 1
- Thanked 0 Times in 0 Posts
Different results with current_timestamp
Hi all,
These 2 scripts give back different results:
With timestamp:
With date:Code:select distinct events.node_name, events.status, nodes.platform_name from events, nodes where events.node_name=nodes.node_name and events.status<>'Completed' and events.status<>'Future' and events.scheduled_start>current_timestamp-1 day
How could I get the timestamp one to work?Code:select distinct events.node_name, events.status, nodes.platform_name from events, nodes where events.node_name=nodes.node_name and events.status<>'Completed' and events.status<>'Future' and events.scheduled_start>'2012-03-28'
It's like it doesn't go back after midnight.
-
03-28-2012, 11:06 AM #2Moderator
- Join Date
- Aug 2005
- Location
- Somewhere in the US
- Posts
- 5,300
- Thanks
- 2
- Thanked 137 Times in 135 Posts
What TSM Sever version are you running?
Ed
-
03-29-2012, 01:15 AM #3Newcomer
- Join Date
- Aug 2011
- Posts
- 10
- Thanks
- 1
- Thanked 0 Times in 0 Posts
TSM version 5.5
-
03-29-2012, 09:55 AM #4Senior Member
- Join Date
- Jul 2008
- Location
- Birmingham, UK
- Posts
- 529
- Thanks
- 0
- Thanked 4 Times in 4 Posts
Hi
I thnk this will work
Change the last part to be
date(events.scheduled_start)>='2012-03-28'
Cheers
-
03-30-2012, 02:47 AM #5Newcomer
- Join Date
- Aug 2011
- Posts
- 10
- Thanks
- 1
- Thanked 0 Times in 0 Posts
Hi,
My problem is that I want to use the current_timestamp, so I don't have to rewrite the date every time I want to use the script.
-
03-30-2012, 05:51 AM #6Senior Member
- Join Date
- Jul 2008
- Location
- Birmingham, UK
- Posts
- 529
- Thanks
- 0
- Thanked 4 Times in 4 Posts
Hi
try this,
select distinct events.node_name, events.status, nodes.platform_name from events, nodes where events.node_name=nodes.node_name and events.status<>'Completed' and events.status<>'Future' and events.scheduled_start>='2012-01-01' and scheduled_start >= current_timestamp - 24 hours
Hope that helps
-
The Following User Says Thank You to ChrisRees For This Useful Post:
SourMylk (03-30-2012)
-
03-30-2012, 06:43 AM #7Newcomer
- Join Date
- Aug 2011
- Posts
- 10
- Thanks
- 1
- Thanked 0 Times in 0 Posts
-
03-30-2012, 07:08 AM #8Newcomer
- Join Date
- Aug 2011
- Posts
- 10
- Thanks
- 1
- Thanked 0 Times in 0 Posts
But I don't really understand why this works
Similar Threads
-
sbttest results
By crpope10 in forum Administrative ClientReplies: 4Last Post: 05-07-2010, 06:30 AM -
Mismatching results !!
By blies in forum ScriptingReplies: 3Last Post: 05-27-2009, 10:42 PM -
Daily Report Results -99
By wsimps01 in forum TSM Reporting & MonitoringReplies: 2Last Post: 02-17-2009, 01:25 PM -
Limiting returned results
By John22439 in forum ScriptingReplies: 7Last Post: 03-12-2007, 11:02 AM -
Query Results Layout
By sfcc in forum TSM Reporting & MonitoringReplies: 6Last Post: 02-02-2004, 10:02 AM


Reply With Quote
