Look like Dave beat me to it!
create table #temp_results
(id int,
[min] date,
[max] date)
GO
truncate table #temp_results
GO
declare
@id int,
@date smalldatetime,
@curr_id int,
@min_date smalldatetime,
@max_date smalldatetime,
@row_count int
declare a_cursor cursor for select
[date],[id]...
Have you looked at Sql Server Reporting Services (SSRS) ?. It has very good scheduler/subcription/email export capability built in.
If you have a sql license then you basically already have this?
Its not clear from your description what you want to do with rows which only have 1 column which isn't null or blank.
Anyway I would just do it as two sql select statements in two different ole db source objects. Or you could union the two together in one select with a hard coded identifier...
If I have understood correctly you want to add users/groups from another domain?
I think to achieve this your network guys will have to establish a 'domain trust'
Sorry but in your new sample you now don't have staff (userid) and are now using RESULTCODE as appointment.
If you have found a script that does what you want then go with that.
Because thats the way nulls behave for comparison.
I allways just use isnull to present an arbitrary value, in this case '' (blank)
SELECT * FROM [MTR_MAT_SUPER_TYPE] WHERE DATEPART(m, [MTR_LODG_DATE]) = DATEPART(m, DATEADD(m, -1, getdate()))
AND [MTR_REG_CODE] is not null
AND...
So you only want ap1,ap2 & ap3 ?
and can you confirm if an ap1 record would always exist, or could you get data for a staff member with just ap2 & ap3? (that you would want)
Thats not the same as it outputs a column and only makes the content null based on a condition.
Oracle noprint and starskys solution don't output the column at all, which is what the op wants.
As Simi has said, need some more detail but shooting from the hip and assuming that the first appointment always exists .....
select
ap1.staff,
ap1.appointment1,
ap1.date1,
ap1.successful1,
ap2.appointment2,
ap2.date2,
ap2.successful2,
ap3.appointment3,
ap3.date3,
ap3.successful3...
As sql express typically installs as an instance .... servername/sqlexpress
you must have the 'SQL Server Browser Service' running.
Also within server properties > security make sure you have the correct 'server authentication' mode. Eg if you are passing a username/password in your string...
>>OPENQUERY (LDOS,"INSERT INTO LDOS.tblProjectnumbers (TransID, >>CustId)VALUES(@TransId,@CustId)"
as a starter this needs a tidy. should be
OPENQUERY (server ,'query')
so single not double quotes in the correct place and the number of brackets are wrong also.
First you can create package variables of type string for the whole connection string, server name or just initial catalog properties (amongst others).
Modify the properties of the connection by expanding the 'expressions' and assigning your variable(s) to the property(s)
To update the...
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.