Showing posts with label company. Show all posts
Showing posts with label company. Show all posts

Tuesday, March 27, 2012

Can't get current value of a field in table header

Ok, I give up (again). I have a report that breaks on company number.
I want to display
="Details for Company " & Fields!Company.Value
in the table header (or in a textbox within the body above the table).
However, I only get the value of the first company number in the dataset,
even when it breaks on company. How is this done?
Thank you very much,
Marc MillerAdd a table group with a grouping expression of =Fields!Company.Value
In the table group header your expression will work ="Details for Company "
& Fields!Company.Value
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marc Miller" <mm1284@.hotmail.com> wrote in message
news:Oa7l51UgEHA.2416@.TK2MSFTNGP10.phx.gbl...
> Ok, I give up (again). I have a report that breaks on company number.
> I want to display
> ="Details for Company " & Fields!Company.Value
> in the table header (or in a textbox within the body above the table).
> However, I only get the value of the first company number in the dataset,
> even when it breaks on company. How is this done?
> Thank you very much,
> Marc Miller
>

Thursday, March 22, 2012

Can't figure out how to write query

I have a table TABLE1. My company has 2 sites. This table contains employees
with the amount of hours they worked on which project at which sites.
code:

CREATE TABLE #TABLE1 (
Calldate varchar(10) NULL,
Employee varchar(10) NULL,
Project varchar(10) NULL,
Hours decimal(10,4) NULL,
Site varchar(1) NULL)
INSERT #TABLE1 (calldate, employee, project, hours, site)
VALUES ('20060217', '123', 'EAUD5', 2.5, '2')
INSERT #TABLE1 (calldate, employee, project, hours, site)
VALUES ('20060217', '246', 'EACQ5', 3, '2')
INSERT #TABLE1 (calldate, employee, project, hours, site)
VALUES ('20060217', '369', 'EACQ5', 2, '1')
INSERT #TABLE1 (calldate, employee, project, hours, site)
VALUES ('20060217', '369', 'EACQ6', 1.5, '1')
INSERT #TABLE1 (calldate, employee, project, hours, site)
VALUES ('20060217', '369', 'EACQ6', 5, '2')


I need to figure out the following:
I need the total hours of employees from both sites ONLY if they worked on a
project that ended in a 5. If employees worked on projects that did not end
in 5 I need the totals for their site only. A parameter of site will be
passed to the stored procedure.
So for example: If site parameter of 1 is passed.
I need to see the following results:
Calldate Project TotalHours
20060217 EAUD5 2.5
20060217 EACQ5 5
20060217 EACQ6 1.5
If site parameter of 2 is passed.
I need to see the following results:
Calldate Project TotalHours
20060217 EAUD5 2.5
20060217 EACQ5 5
20060217 EACQ6 5
Any help would be greatly appreciated,
Thanks,
ninel
Message posted via http://www.webservertalk.comThanks for posting DDL and sample data.
declare @.site varchar(1)
set @.site = '1'
select calldate, project,
sum(case when site = @.site or right(project,1) = '5' then hours else 0 end)
from #table1
group by calldate, project
set @.site = '2'
select calldate, project,
sum(case when site = @.site or right(project,1) = '5' then hours else 0 end)
from #table1
group by calldate, project
"ninel g via webservertalk.com" wrote:

>
I have a table TABLE1. My company has 2 sites. This table contains employe
es
>
with the amount of hours they worked on which project at which sites.
>
>
code:

>
CREATE TABLE #TABLE1 (
>
Calldate varchar(10) NULL,
>
Employee varchar(10) NULL,
>
Project varchar(10) NULL,
>
Hours decimal(10,4) NULL,
>
Site varchar(1) NULL)
>
>
INSERT #TABLE1 (calldate, employee, project, hours, site)
>
VALUES ('20060217', '123', 'EAUD5', 2.5, '2')
>
>
INSERT #TABLE1 (calldate, employee, project, hours, site)
>
VALUES ('20060217', '246', 'EACQ5', 3, '2')
>
>
INSERT #TABLE1 (calldate, employee, project, hours, site)
>
VALUES ('20060217', '369', 'EACQ5', 2, '1')
>
>
INSERT #TABLE1 (calldate, employee, project, hours, site)
>
VALUES ('20060217', '369', 'EACQ6', 1.5, '1')
>
>
INSERT #TABLE1 (calldate, employee, project, hours, site)
>
VALUES ('20060217', '369', 'EACQ6', 5, '2')
>


>
>
I need to figure out the following:
>
I need the total hours of employees from both sites ONLY if they worked on
a
>
project that ended in a 5. If employees worked on projects that did not en
d
>
in 5 I need the totals for their site only. A parameter of site will be
>
passed to the stored procedure.
>
>
So for example: If site parameter of 1 is passed.
>
I need to see the following results:
>
>
Calldate Project TotalHours
>
20060217 EAUD5 2.5
>
20060217 EACQ5 5
>
20060217 EACQ6 1.5
>
>
If site parameter of 2 is passed.
>
I need to see the following results:
>
>
Calldate Project TotalHours
>
20060217 EAUD5 2.5
>
20060217 EACQ5 5
>
20060217 EACQ6 5
>
>
Any help would be greatly appreciated,
>
>
Thanks,
>
ninel
>
>
--
>
Message posted via http://www.webservertalk.com
>
|||Thnak you so much for teh quick response.
Mark Williams wrote:
>Thanks for posting DDL and sample data.
>declare @.site varchar(1)
>set @.site = '1'
>select calldate, project,
>sum(case when site = @.site or right(project,1) = '5' then hours else 0 end)
>from #table1
>group by calldate, project
>set @.site = '2'
>select calldate, project,
>sum(case when site = @.site or right(project,1) = '5' then hours else 0 end)
>from #table1
>group by calldate, project
>
>[quoted text clipped - 49 lines]
Message posted via http://www.webservertalk.comsql

Wednesday, March 7, 2012

Cant create connection to database

I am having trouble creating a connection to an MS SQL 2000 database located on a server at the hosting company I'm using, with code running from my localhost. It works when the code is executed on the server at my hosting company, but not when it is executed locally, on my computer. Also, I can't connect to the database using Enterprise Manager. The error I get is this:

SQL Server does not exist or access denied

It has worked before, so I don't understand why it doesn't anymore. It's not a firewall issue, since I have tried to connect with my firewall disabled as well.

Any tips or ideas?have you tried those obvious things like using ip in place of server name? when this error appears and there is evidence that the server is running and nothinng is misspelled it just means that the network library selected is not the one that can reach the target (that's lame interpretation, i'm sure there'll be someone to take the trouble to translate it into unreadable scientific terms ;))|||Yup, have tried using IP instead. No luck.|||Your problem may be as simple as the SQL Server installation being on a dynamic port or as complex as a problem with the hosting companies firewall. Have you tried connecting the hosting company and asking them for outside connection parameters?

Randy
www.Database-Security.Info|||Yes, I have contacted them. Several times. And the say that they can connect to the database (on port 1433) from an external network, using the exact same username and password I'm using.

Friday, February 10, 2012

Cant connect from MS Access 2000 to SQL server 2000

Since the webhosting company's upgraded its SQL server 7 to SQL server 2000, I'm not able to connect from MS Access 2000 to the server and update a DB with 'Convert to SQL database' tool. All I got was a message window with text 'Overflow'. Then I updated Access with SR pack 1 and SQL 2000 readyreness kit. The only thing what changed was the text on the message window. Now it says '[DBNETLIB] [Connection Open(Connect()).] SQL server doesn't exist or the access was refused' if I use already created ODBC data source. If I create a new ODBC data source, the wizard lets me do all steps, starts transferring and abruptly ends with message that transferred tables were skipped or the transfer was unsuccesful.

Can anybody help me ?

Or is there any other tool with which I can update tables on MS SQL server ?

thanks

GlowiQ1 Can anybody help me ?
Q2 Is there any other tool with which I can create and modify tables on MS SQL server ?
A1 Possibly.
A2 You may wish to consider using MS Sql Server Enterprise Manager, EM, or Query Analyzer, QA, a.k.a.(ISQLW), to aid you in assessing where (and possibly how) the procedures you were attempting to complete have failed (and / or to complete or redo the process, to complete your desired task(s)). It may be easier to import the structures, etc., from EM.