User Profile

Collapse

Profile Sidebar

Collapse
taoh15
taoh15
Last Activity: Mar 5 '08, 09:07 PM
Joined: Feb 2 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi

    This may seem realy silly but the easiest way is open up Access. Edit the query, change to SQL view, select all and copy.

    Now open SQL Server Management studio add a view, don't select any table and just paste into the SQL code windows, save and give it name.

    Cheers
    Taoh
    See more | Go to post

    Leave a comment:


  • taoh15
    replied to Newbie : Updating a table from a query
    Thanks

    That did it.

    With a little help from Query Optimizer the 3.5hr operation not takes 3 secs :-)

    Taoh
    See more | Go to post

    Leave a comment:


  • taoh15
    started a topic Newbie : Updating a table from a query

    Newbie : Updating a table from a query

    All

    I have two tables

    Table1 has three fields empid,elid, stats
    Empid and Elid are unique
    Table2 contains many values of empid,elid and apstatid

    I need to do something like this
    UPDATE Table1 SET Table1.stats= (SUM(Table2.aps tatid)/COUNT(Table2.ap statid)) FROM
    Table2 WHERE Table2.empid= Table1.empid AND Table2.elid= Table1.elid

    How do I do it?
    ...
    See more | Go to post

  • taoh15
    replied to Newbie: Find unique records
    Sorry All Ignore my question.

    As soon as I finished the post I realised the answer.
    My excuse it that I am try to understand somebody elses code and my original question was going to be about a problem later on in the routine but as I wrote the post I realised I was going to ask the wrong question.

    Definately a case of not seeingthe wood from the trees:-)
    Cheers
    Taoh
    See more | Go to post

    Leave a comment:


  • taoh15
    started a topic Newbie: Find unique records

    Newbie: Find unique records

    Hi All

    Although I have been using SQL2K for a number of years this is my first venture into more complicated stuff.

    I have a query

    SELECT apd.elid , apd.pcid , apd.apstatid , ap.empid
    FROM ap RIGHT OUTER JOIN
    ar ON ap.apid = ar.apid RIGHT OUTER JOIN
    apd ON ar.arid = apd.arid
    WHERE ap.empid IN (
    SELECT emp.empid FROM emp LEFT OUTER JOIN ...
    See more | Go to post
No activity results to display
Show More
Working...