Hi I have an append query I want to turn into an SP so it runs faster on the server, only I am using some access functions.
How do I convert this SQL into an SP ?
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta
How do I convert this SQL into an SP ?
Code:
INSERT INTO Search_Contacts ( CompanyName, ContactID )
SELECT Contacts.CompanyName, Contacts.ContactID
FROM Contacts
WHERE (((Contacts.MembershipLevel)="Appointed Rep")) OR (((Contacts.ContactTypeID) Like '*- AR')) OR (((Contacts.ContactTypeID) Like 'Prospect - *'))
GROUP BY Contacts.CompanyName, Contacts.ContactID
HAVING (((Contacts.CompanyName) Is Not Null And (Contacts.CompanyName)<>')) OR (((Contacts.CompanyName) Is Not Null And (Contacts.CompanyName)<>')) OR (((Contacts.CompanyName) Is Not Null And (Contacts.CompanyName)<>') AND ((Nz(DLookUp("ContactID","Contacts","CompanyName = '" & [companyname] & "' AND (ContactTypeID = 'Prospect - AR' OR MembershipLevel = 'Appointed Rep')"),0))=0));
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta