...which stores information into temp tables however I’m sure there is a better way of do this. Any help or suggestions would be grateful.
SELECT *
INTO #EMAIL
FROM KeyCareClean
WHERE NOT EXISTS
(select *
from STUDENT
where Upper(KeyCareClean.EmailAddress) =...
Just to add to this i've just broken up the store procedure to on run the first part
Declare @Year_Local varchar(4) = '2010', @Quarter_Local varchar(9)= null, @Month_Local varchar(3)=null, @Silo_Local varchar(2) = null
Select Person_name, MaginusAccount, Account_Name, 'Person Target...
...= 1
Group by Person_name, Arrow_Silo_Name,MaginusAccount, Account_Name
Union ALL
Select t1.*, 'Targeted Non-Visit' as SiloTarget
From
(SELECT Sales_Matrix.Sales_Person, TimeCard_Targeted_Lookup.TimeCard_Acct, TimeCard_Targeted_Lookup.Customer_Name
FROM...
Can any one suggest how i might improve the performance of this store procedure? It seem to take a while to run and im sure there is a better way of writing it...
Declare
@Year_Local varchar(4),
@Quarter_Local varchar(9),
@Month_Local varchar(3),
@Person_name_Local varchar(100)
Select...
Anyone got any ideas on how i might get the above working.
I want the bottome where clause to be a parameter so the user can type either visited or not visited
Cheers
I've written this query, however im not sure it the best way to write it. Could someone please help?
Thanks in advance
Select t1.*
From
(Select Silo,Arrow_Silo_Name, AccountName,Account_Name
From Sales_Matrix inner join Arrow_Silo_Description
on Sales_Matrix.Silo =...
Hi Guys, I have this query below: It works fine however i'd like to use
Where t2.NumberOFMeeting = 'Not visited' in the where clause instead of:
where t2.NumberOFMeeting is null
any help would be appreciated
Declare @Year varchar(4) = 2010, @Quarter varchar(9) = null, @Month varchar(3) =...
I've created a store procedure using this information however when i try and run the procedure in the form of EXEC Storeprocedure '2010'. It states it requires the @Quarter parameter
Any ideas?
ALTER PROCEDURE [dbo].[Report_1_Visits_by_Targeted_and_Un-Targeted]
-- Add the parameters for the...
This is what im try to get to, is this the best way of writting this?
Select t1.AccountName, IsNull(t2.NumberOFMeeting,0) as NumberOFMeeting
From
(Select AccountName
From Sales_Matrix
Group By AccountName)t1 left outer join (Select MaginusAccount, ISNULL(Count(AccountName),0) As...
Sorry to bother you all again.
Im trying to join these two queries together, can you help.
I need all the accounts in query one and a count of meetings that have have taken place which are in query two... I know i need to join on accountName but am unsure how to join the 2 queies
Select...
Can you help me with this GOTO statement
Declare @Year varchar(4) = '2010', @Quarter varchar(9) = null, @Month varchar(3) = Null
If @Quarter = null and @Month = null GOTO Step_One; Else GOTO Step_Four;
Step_One:
SELECT 'StepOne', CASE Targeted_Account
WHEN 'TRUE' THEN 'Targeted' ELSE...
Hi Guys,I've been given a task to rewirte a bit of SQL and was wondering if you could help me out. The bit of sql below takesa while to run so any help would be greatful.
select NET_AMOUNT,UNIT_AMOUNT,QUANTITY,to_Char(PRO_ID) as ProID,to_Char(PER_ID) as PerID,to_Char(MEM_ID) as MEM_ID
from...
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.