Thanks for the input everyone.
Thanks Ryan, here is my query.
DECLARE @pKeyID int
SET @pKeyID = 12347
SELECT *
FROM rc_Events
WHERE MeetingID = (SELECT TOP 1 MeetingID FROM rc_Events WHERE EventID = @pKeyID)
UNION
SELECT *
FROM rc_Events
WHERE EventID = (SELECT TOP 1 MeetingID FROM rc_Events...
We use SQL Server 7.
This is how my rc_Events data looks:
EventID MeetingID
12345 0
12346 12345
12347 12345
12348 12345
12349 0
12350 54321
12351 54321
I want to select the MeetingID records with the ID 12345 and the EventID with the ID 12345 using @pKeyID which...
Yes, you're right! been a long day. Should read
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 rc_Contacts.ContactID...
Sorry, that wasn't very clear was it?
The first Select picks everything where the rc_Events.MeetingID = the passed parameter @pKeyID
I also need to Select all records where rc_Events.MeetingID = the rc_Events.MeetingID selected from the first select. I did a UNION query because that seemed...
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...
Thank you so much Alex and George you are life savers, I would never have worked this out myself. I have tweaked the code to include counts and a few more joins, but it appears to be doing exactly want I want.
SELECT co.BranchCode, co.Representative, cl.ClientName, co.DecisionMaker...
I need to show the subject for both calls, the most recent completed & the most recent uncompleted. Here are my fields:
SELECT co.BranchCode, co.Representative, rc_Clients.ClientName, co.DecisionMaker, co.ContactSurname, co.ContactFirstname, co.SalesType, co.SalesStatus, rc_Clients.Terms...
Thanks Alex, that works. Any idea why my Max(Date) isn't working though. I'm getting all the calls for each contact whereas I only want the latest completed call and the latest uncompleted call.
Thanks
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...
The first column is pre-filled and the second column is entered by the user. The user opens the cv, clicks the format button, types the candidates details in the second column, checks the formatting of the cv text and saves the document.
Ok, the header is just our company logo .jpg and the header is text, address, phone numbers etc.
The table on the first page is a summary table, 10 rows by 2 columns:
Applicant Joe Bloggs
Contact 020 8777333
Nationality British
Resides London
Willing to...
Hi Gerry,
We receive cv's in .doc or .rtf format. They always have different layouts; different margins, fonts, number of pages etc. I want to open the cv in Word, click the button on the toolbar and trigger the macro to do what you said above:
1. go to the start of the CV document
2. add a...
Gerry, one more thing:-)
Is there an easy way to copy the margin settings of the CV across? NewDoc uses the templates margins and this can alter the formatting of the CV. Not a big deal but a happy user is a quiet user!!
John
Thanks alot Gerry, you're a star.
I couldn't get Selection to be a property of ActiveDocument but this code works:
Set NewDoc = ActiveDocument
With NewDoc
.ActiveWindow.Selection.EndKey Unit:=wdStory
.ActiveWindow.Selection.InsertBreak Type:=wdPageBreak...
Hi Gerry,
I am trying to format CV's with a standard template. The template contains a header and a footer and a table in the main body. I want the user to open the CV and click the Format CV button on the toolbar in Word. This will insert the template header on the first page and footer on all...
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.