Quey Help

Jul 23, 2005

Excuse me for not putting a better name to this but I cannot think of a
suitable subject title!

anyway, here's what I am trying to do

At work we have a fair amount of data that is to do with people and what
jobs they have completed and at what date
so for example
Joe Bloggs did design work at 12/12/2004 and spent 5 hours on it.
Now, we have a lot of jobs that people haven't put any hours down for at
all,
and I want to find all those jobs which have had no hours put to them since
the 30/09/2004
I had written a query like so
SELECT name, job, date
FROM table
WHERE hours = 0 AND date >='30/09/2004'
But this doesn't work as some jobs may come up which have had zero hours on
some particular dates but on some dates that job does have hours on.
What I want is to show since 30/09/2004 any jobs which have had no hours at
all booked to them consistently.
So in effect all the jobs we know longer use and haven't since that date.

How would I do that?
I know you can probably only give me a vague idea as I have provided no
table structure etc.. but I only want a hint really...

Thanks

Jayne

View 2 Replies


ADVERTISEMENT

Better Quey Then This

May 18, 2000

Hello,
I am trying to insert records in a table say "TableB"
from "TableA". If a record does not exist in Tableb
then and then insert record from tableA.
as of now my query is
insert tableB
select * from tableA
where id not in(select id from tableB).
I am working with about 200000 records. This query is taking too long. Does any one have a better suggestion.
Thanx for your time.
Hiku

View 1 Replies View Related

Which Quey Is More Powerful

Nov 1, 2007

Hi experts,
what is the scope of # and what is the scope of @

create table #temp(COLUMN01 VARCHAR(500))

DECLARE @TEMP TABLE(COLUMN01 VARCHAR(500))

thanks in advance


Vinod
Even you learn 1%, Learn it with 100% confidence.

View 2 Replies View Related

I Ran A Update Quey By Mistake

Sep 24, 2006

With out any BEGIN Transaction statement , i ran a update query.

I had to update just one record using the "Where field='abc'"

But i happened to miss that. Is there any chance of recovery? can i use the transaction logs to bring back the records before the update?

A quick answer is appreciated.

Sahel

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved