Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Converting a Access SQL statement

Author  Topic 

pwynn
Starting Member

4 Posts

Posted - 2004-03-31 : 12:12:56
I am not an SQL person at all but i need to write a select statment. i have written it in access but it will not work. i have cleaned it up a bit to where i think it is right. but it still does not work.

here is the statment
SELECT WORKORDER.WONUM, WORKORDER.DESCRIPTION, JOBLABOR.JPNUM, JOBLABOR.LABORHRS
FROM JOBLABOR INNER JOIN WORKORDER ON JOBLABOR.JPNUM = WORKORDER.JPNUM
WHERE ((WORKORDER.DESCRIPTION) Like "%T3400%") AND ((JOBLABOR.LABORHRS)=0.0)));

i get the ORA-00933: SQL Command not properly ended error.

help would be greatly appreciated.
Thanks

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-03-31 : 12:28:12
Is this oracle ??

- Jeff
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 12:29:12
SELECT w.WONUM, w.DESCRIPTION, j.JPNUM, j.LABORHRS
FROM JOBLABOR j
INNER JOIN WORKORDER w
ON j.JPNUM = w.JPNUM
WHERE w.DESCRIPTION LIKE '%T3400%' AND j.LABORHRS = 0.0

Does that work?

Tara
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 12:29:58
Oh Oracle! I think you need then:

SELECT w.WONUM, w.DESCRIPTION, j.JPNUM, j.LABORHRS
FROM JOBLABOR j, WORKORDER w
WHERE j.JPNUM = w.JPNUM AND w.DESCRIPTION LIKE '%T3400%' AND j.LABORHRS = 0.0

Tara
Go to Top of Page

pwynn
Starting Member

4 Posts

Posted - 2004-03-31 : 12:44:55
thank you that worked, now i just have to figure out how to make it work in maximo. it will not take that query, any ideas?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 12:47:19
What's maximo?

Tara
Go to Top of Page

pwynn
Starting Member

4 Posts

Posted - 2004-03-31 : 15:50:21
Maximo is a maintenance management software.

here is a typical query in it.

WHERE exists (select siteid from MAXIMO.wplabor where ((laborHRS like '0')) and (wonum=workorder.wonum AND STATUS LIKE 'COMP' and siteid = 'EMWD'))
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 16:13:30
So is this for Oracle? This is a MS SQL Server site. I think dbforums.com has an Oracle forum.

Tara
Go to Top of Page

pwynn
Starting Member

4 Posts

Posted - 2004-03-31 : 17:07:06
yes i know but i was told that i could probably get my answers here.
sorry if i upset anyone.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 17:55:58
Nah, no one is upset. We just need to know if this isn't a SQL Server question. We can provide the answer, but it will usually only be SQL Server specific. So if you've got an Oracle question, we can probably provide the SQL Server answer, the poster will need to convert the statement to Oracle though.

Tara
Go to Top of Page
   

- Advertisement -