Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: JohnnyLong
  • Content: Threads
  • Order by date
  1. JohnnyLong

    SELECT using an ID from a SELECT

    Hi, My second Select is based on the results of the first Select. SELECT rc_Contacts.ContactID, rc_Events.EventID, rc_Events.MeetingID FROM rc_Contacts LEFT OUTER JOIN rc_Events ON rc_Contacts.ContactID = rc_Events.ContactID WHERE rc_Events.MeetingID=@pKeyID UNION SELECT...
  2. JohnnyLong

    Select Max into one row

    Hi, I have 2 tables, rc_Contacts and rc_Calls. Each contact can have many calls. rc_Calls has a CompletedFlag column of 1 or 0. I need to select the last completed call and the last uncompleted call and display the results in one row. Surname Subject MaxCallDate1 Subject MaxCallDate2...
  3. JohnnyLong

    Contractors churn rate

    Hi, I have been asked to produce a query showing the churn rate for our contractors. We have a timesheet table which records their weekly timesheets, the week number and date of each timesheet. I need to show the length in weeks of each contractors assignment with any break between timesheets of...
  4. JohnnyLong

    Insert text into first page header only.

    I have a Word 2000 macro that inserts text and logos into the header and footer of word docs. How do I change it so the text is only inserted into the first page header? Here is the code: Sub FormatCVTemplate() Dim tmpFileName Dim Template Dim OriginalFileName Dim OriginalPath...
  5. JohnnyLong

    Help needed to query data

    I have a Timesheet table which stores the employee names and week commencing dates for each timesheet (they are paid weekly). I need to see who has not received a timesheet in the last 4 weeks. Here is an example of my data: Name TS Week John Smith 06/11/2006 John Smith...
  6. JohnnyLong

    Move Row from one datagrid to another

    I have a form with 3 tabs. Tab1 has a datagrid displaying candidate details. I want to right click a row and using the contextmenu click Shortlist to move the selected row to a datagrid on Tab2 and click Reject to move the selected row to a datagrid on Tab3. How would you go about this? I'm...
  7. JohnnyLong

    Temp table help

    Hi, I need some advice on the best way to solve the following: SELECT CandidateID FROM Notes WHERE CONTAINS(subject, '"fish*"') UNION SELECT CandidateID FROM Notes WHERE CONTAINS(comments, '"fish*"') UNION SELECT CandidateID FROM CandidatesNotes WHERE CONTAINS(CandidateNotes, '"fish*"') This...
  8. JohnnyLong

    Passing a string to a stored procedure

    Hi, I'm having real problems running a stored proc with a string passed from vb.net. In query analyzer I can successfully run the following dynamic sql query: DECLARE @pSearch1 as varchar(500), @pSearch2 as varchar(500), @pSearch3 as varchar(500) SET @pSearch1 = 'SELECT SurName,FirstName FROM...
  9. JohnnyLong

    Full Text Search column name parameter

    Hi there, Does anyone know how to use a parameter as a column name in a CONTAINS stored procedure, so instead of: SELECT surname, firstname FROM Candidates WHERE CONTAINS(Candidates.Surname, @pSearch2) I need to use: SELECT surname, firstname FROM Candidates WHERE CONTAINS(@pSearch1...
  10. JohnnyLong

    INSERT INTO and SELECT statement

    Hi there, We have a SQL7 table where each record holds 5 CandidateID's (CandidateID1 to CandidateID5). We now need to split Candidate2, 3, 4 and 5 so they have their own record. I need to insert a record into tblEvents, return the Identity and insert the record into tblCVDespatch using the...
  11. JohnnyLong

    Subtotal of visible fields only

    Hi there, I am using Crystal 9 and am having a problem subtotalling a field in a group footer. I have 3 groups and the "Required" field from the stored procedure is in Group Footer #3 under the Details (so it doesn't repeat for every detail line). How do I subtotal this field in Group Footer...
  12. JohnnyLong

    Simple Update Query with Joins

    I have never been able to get my head around Update queries with joins. Can anyone help? I need to update the text field CVText on table rc_CVData with tblApplicants2.CV_TEXT. I have to join these two tables through table rc_Candidates using the Key Applicants_APP_ID. UPDATE rc_CVData SET...
  13. JohnnyLong

    Speed up a stored procedure

    Hi, Does anyone know how I can improve the performance of this stored proc? CREATE PROCEDURE sp_DocumentCategoryFind @pCandidateID AS int, @pClientID AS int, @pContactID AS int AS SELECT rc_Documents.DocumentID, Subject, Category, FullPathName, ModifiedDate, ModifiedBy, CandidateID, ClientID...
  14. JohnnyLong

    Select within a Select

    Hi, I am trying to fetch names from the rc_Candidates table and the corresponding FullPathName from the rc_DocumentAttachments table but I have to join using the rc_Documents table. This statement selects the 14 names I want but all the FullPathNames in the table SELECT...
  15. JohnnyLong

    WHERE in WHERE

    Is this possible? I'm using SQL7. I have a table like this: ID WeekCount WeekCommencing 001 1 28/02/2005 002 2 07/03/2005 I want to replace WeekCommencing 28/02/2005 with WeekCommencing 07/03/2005. I came up with this pseudo sql code : UPDATE...
  16. JohnnyLong

    Select a record, then Insert same record but diff data

    Hi Everyone, Can somebody please tell me how to SELECT a record from a table and then INSERT the same record to the same table but with a small change to the data. Like this: SELECT * FROM rc_Events WHERE ContactID = 10038214 INSERT INTO rc_Events(EventType, Subject, ClientID...
  17. JohnnyLong

    Crystal 9 Multiple Select statements in Stored Procedure

    I have been asked to produce reports to show when a certain date has expired. Instead of having 5 separate reports we would like to have just 1. We want to use 1 stored procedure like this CREATE PROCEDURE sp_CertificateReports AS /***A8 Returned By***/ SELECT Surname AS SurnameA8, FirstName...
  18. JohnnyLong

    Severe error using SQL7 & ADO.Net

    I'm filling a dataset using ADO.Net and a stored procedure. But I'm getting the error message: "A severe error occurred on the current command. The results, if any, should be discarded." Strangely, the stored proc works perfectly in the Query Analyzer and if I duplicate the query in MS Access...
  19. JohnnyLong

    Save ComboBox values in Word Document

    I have a Word 2000 document with 8 comboboxes. I want to email this document to a client for them to select there values and email the document back. How do I save the values they have chosen in the comboboxes? I populate the combos in Document_Open and then: Dim oProp As DocumentProperty '...
  20. JohnnyLong

    Email

    I've been trying to use the Outlook object library to send emails but have discovered problems due to different clients using different versions of Outlook. I've seen the FAQ on Automatic Email using SMTP. Will I be able to send multiple Cc's/BCcs and attachments using this method? John.

Part and Inventory Search

Back
Top