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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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
'...
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.