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.
| Author |
Topic |
|
jar21
51 Posts |
Posted - 2008-09-04 : 15:57:30
|
| Hi this query is used to display who has not been paid, but when its run it simply times out. This query was given to me by a 3rd party company and I know extremely little about Queries, I just want to check with people I believe may know more :-)SELECT distinct(OrderAssignment.Assignment_ID), EmployeeMaster.First_Name, EmployeeMaster.Last_Name, OrderAssignment.Start_DateTime, OrderAssignment.End_Actual_DateFROM EmployeeMaster, OrderAssignment, OrderMasterWHERE OrderAssignment.Employee_ID = EmployeeMaster.Employee_ID AND OrderMaster.Order_ID = OrderAssignment.Order_IDAND (OrderAssignment.End_Actual_Date Between {ts '2008-01-01 00:00:00'} And {ts '2008-09-30 00:00:00'}) OR (OrderAssignment.End_Actual_Date Is Null)and orderassignment.assignment_id not in (select AssignmentKey from AIM_TimecardHIST where WeekEnding Between {ts '2008-01-01 00:00:00'} And {ts '2008-09-30 00:00:00'})when it runs it does nothing at all but time out after a certain amount of time.Enjoy Life This Is Not A Rehearsal. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jar21
51 Posts |
Posted - 2008-09-04 : 16:16:39
|
| I'm extremely lacking knowledge in this area.....(HUGE NOOB) by indexes I'm not even sure what you mean. (pretend you are talking to someone who knows absolutely nothing about SQL'sEnjoy Life This Is Not A Rehearsal. |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-09-04 : 19:21:39
|
| Then get the knowledge about it. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-09-04 : 19:31:59
|
quote: Originally posted by sodeep Then get the knowledge about it.
We don't need this kind of attitude here. Do not post rude comments like this or your account will be locked.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
jar21
51 Posts |
Posted - 2008-09-05 : 11:23:00
|
| I believe there are 37 indexes (I checked by going into the sql server and expanding the databases then expanding indexes, I'm not sure if thats what you meant. while it may have been rude, hes right albeit I'm 21, and havent touched a database up until about 3 or 4 weeks ago.p.s. we edited the query and it works now. I'm not entirely sure what is different but there is one line that was added (from what I can see) "ORDER BY 1"Actually as a side note, is there a view or query I can run to view.. say.. the last 15 databases or 500 fields?Enjoy Life This Is Not A Rehearsal. |
 |
|
|
|
|
|
|
|