Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Date Range SQL Help

Date Range SQL Help

Date Range SQL Help


I am a Maximo superuser and not an IT professional, I build simple queries and piece together more complex one from previousily used queries. I am trying to get a snapshot of data from a month based on active status' and I can't seem to get the results I am looking for. For example below I am tring to gather all the work orders with:
1. Classification = Vessel (ancestor = '1557')
2. Work Order Status not in ('INCOMP','WORKCOMP','COMP','CAN','CLOSE') completed status
3. Date = the month of March 2016 (All work orders not in these status as of March 1-31 or even date <= March 31st, regardless of the current status)

where(status not in (select value from synonymdomain where domainid = 'WOSTATUS' and maxvalue in ('INCOMP','WORKCOMP','COMP','CAN','CLOSE')))and((woclass = 'WORKORDER' or woclass = 'ACTIVITY') and historyflag = 0 and istask = 0 and siteid = 'PWCAN')and assetnum in (select assetnum from asset where (exists (select 1 from maximo.classancestor where ((ancestor = '1557')) and(classstructureid=asset.classstructureid))))and maintacttype = 'INSPECTION' and where changedate between to_date ('2016-03-31 23:59:00.000' , 'YYYY-MM-DD HH24:MI:SS.FF')and to_date ('2016-01-01 00:00:00.000' , 'YYYY-MM-DD HH24:MI:SS.FF')and location in (select location from locancestor where ancestor in (select location from locationusercust where personid=:&personid&))

Thanks in advance for any super basic insight someone might have.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close