Passthrough query to remember password

RobTuby

Registered User.
Local time
Today, 08:24
Joined
Nov 24, 2014
Messages
25
Hi

I have the following query that has been developed for me but it constantly asks for the password.
Is there a way of storing/automating this for reporting?

Code:
SELECT dbo.tbl_staff.Name, dbo.tbl_function.funct, dbo.tbl_dates.CalendarDate, dbo.tbl_activity.Details
FROM dbo.tbl_staff INNER JOIN dbo.tbl_function ON dbo.tbl_staff.Funct = dbo.tbl_function.id
CROSS JOIN dbo.tbl_dates  
LEFT JOIN dbo.tbl_activity ON dbo.tbl_activity.idstaff = dbo.tbl_staff.id AND dbo.tbl_activity.startdate = dbo.tbl_dates.CalendarDate 
WHERE dbo.tbl_dates.CalendarDate between '11/01/2014' and '12/31/2015' 
AND (dbo.tbl_function.funct Like 'N%' Or dbo.tbl_function.funct Like 'SW%' Or dbo.tbl_function.funct Like 'SE%' Or dbo.tbl_function.funct='LON' Or dbo.tbl_function.funct Like 'OH%') 
AND dbo.tbl_staff.Status=1 
AND isnull(dbo.tbl_activity.Activitytype,34)=34
ORDER BY 1,2,3;

Username = Generic
Password 123
Connection name = MyProduction
Server = mydb\sqlmds001

Thanks

Rob
 
i suppose the only other way is to do multiple queries?
will that work if so how do i need to break the queries down?
 

Users who are viewing this thread

Back
Top Bottom