Results 1 to 8 of 8
  1. #1
    Newcomer
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Different results with current_timestamp

    Hi all,

    These 2 scripts give back different results:

    With timestamp:
    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
    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>'2012-03-28'
    How could I get the timestamp one to work?
    It's like it doesn't go back after midnight.

  2. #2
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,939
    Thanks
    4
    Thanked 234 Times in 229 Posts

    Default

    What TSM Sever version are you running?
    Ed

  3. #3
    Newcomer
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    TSM version 5.5

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Location
    Birmingham, UK
    Posts
    537
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default

    Hi

    I thnk this will work

    Change the last part to be

    date(events.scheduled_start)>='2012-03-28'

    Cheers

  5. #5
    Newcomer
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Senior Member
    Join Date
    Jul 2008
    Location
    Birmingham, UK
    Posts
    537
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default

    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

  7. The Following User Says Thank You to ChrisRees For This Useful Post:

    SourMylk (03-30-2012)

  8. #7
    Newcomer
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ChrisRees View Post
    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
    This one works!
    Thank you!

  9. #8
    Newcomer
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    But I don't really understand why this works

Similar Threads

  1. sbttest results
    By crpope10 in forum Administrative Client
    Replies: 4
    Last Post: 05-07-2010, 06:30 AM
  2. Mismatching results !!
    By blies in forum Scripting
    Replies: 3
    Last Post: 05-27-2009, 10:42 PM
  3. Daily Report Results -99
    By wsimps01 in forum TSM Reporting & Monitoring
    Replies: 2
    Last Post: 02-17-2009, 01:25 PM
  4. Limiting returned results
    By John22439 in forum Scripting
    Replies: 7
    Last Post: 03-12-2007, 11:02 AM
  5. Query Results Layout
    By sfcc in forum TSM Reporting & Monitoring
    Replies: 6
    Last Post: 02-02-2004, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •