Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Thursday, March 29, 2012

Can't get more than first field to evaluate.

I am having trouble getting an

IMBogus1 -

Can you provide more details about your problem? I'm afraid you haven't given us enough information to even know what you were doing when you had problems.

thanks,

|||We are still waiting on information from you. If we don’t hear from you in the next seven days, we will delete the thread. We do this to keep the system full of useful information for customers searching for answers and focus expert attention on active unanswered questions.|||

The trouble I am having is doing an evaluation expression of multiple results and looking for the entire sum of the results in my evaluation expression. Instead it only returns the sum or count of the first result field and ignores all the other result fields.

Thanks,

Pete

|||

Pete -

I can't tell from your description whether you are having this issue with a feature of Team Edition for Database Professionals, or whether you're having some sort of general Visual Studio problem. Can you provide a little more background? What Visual Studio feature are you using when you encountering this problem? Is this something you are running in to while using the Database Unit Testing features?

|||i am working on sql reporting|||

Ah, okay. I've moved your thread to the SQL Server Reporting Services forum, where you can get a better response about SQL Server Reporting questions.

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
>

Cant get CAST function to work in ASP.NET

I'm trying to do something like this SQL statement. I have a table with a field of date/times.

i.e - 2/27/06 9:55:95 PM Basically there are multiple entries in the table per day.

I want to count the records for particular (hence the CAST) and output the count.

Here it was I had just to see if SQL would work in ASP.NET :

SELECT COUNT(*) AS Expr1
FROM dbo.tblActiveDrums
WHERE [CAST](FLOOR([CAST](NCTimeStamp AS [float])) AS datetime) = '0' OR
NCTimeStamp - [CAST](FLOOR([CAST](NCTimeStamp AS [float])) AS datetime) = '0'

It didn't like the AS references?

Any help would be appreciated.

Remove all the brackets and post if there are any error messages. Shouldn't be.|||You want to count the records for a particular what?

Thursday, March 22, 2012

Can't find how to add a line feed to a textbox

Hello,
I'm creating a report with a textbox that contains a field from the dataset
and some hard text (something like =First(Fields!MyField.Value) & "
TheTextPart"). This works, but when I try to do a shift+enter (line feed) I
get an error "The value expresxsion for the textbox 'textbox7' contains an
error: [BC30648] String constants must end with a double quote".
Is there any way to add a line feed / carriage return in a text box?
Thanks!
Ricktry this:
=First(Fields!MyField.Value) & vbcrlf & "The Second Line" & vbcrlf &
"The Third Line"|||Brilliant! Thanks Sleepy!
"SleepyLab" <david.blancard@.fairmont.com> wrote in message
news:1187036726.406106.312410@.d55g2000hsg.googlegroups.com...
> try this:
> =First(Fields!MyField.Value) & vbcrlf & "The Second Line" & vbcrlf &
> "The Third Line"
>

Cant figure out this query

I have a table with multiple records.

Some have the same value in the 'subkey' field.
I want to select all the records from the table that have their highest MAINKEY.

So say there were 4 records in the table that has 3 fields (id, subkey and mainkey)

Each record has a unique id field but the subkeys are the same for the first two and the sub keys are the same for the last two while the Mainkey can be different.

So the tables looks sort of lLike this:

ID SK MK
1 10 2
2 10 3
3 25 2
4 25 3

I want to query and select one record for each subkey, but I want it to be record that has the highest mainkey. In this case, it would be records with ID 2 and 4.

I can not figure this out. :eek:

Any help would be GREATLY appreciated.This works...

SELECT [ID]
FROM yourtable T1
WHERE EXISTS (
SELECT SK, MAX(MK) AS MK
FROM yourtable T2
WHERE T1.SK=T2.SK
GROUP BY SK
HAVING T1.MK=MAX(T2.MK))|||select a.id, a.sk, a.mk from yourtable a
where a.mk in(select max(b.mk) from yourtable b
where a.sk = b.sk)|||Simpler even:

select a.sk, max(a.mk) as MK from yourtable a
group by a.sk

Tuesday, March 20, 2012

cant enter data in field

I have a field in my table that is varchar:1500:null, but I cannot enter any more that 994 characters. any ideas why?

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Quotes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Quotes]
GO

CREATE TABLE [dbo].[Quotes] (
[QuoteID] [int] IDENTITY (1, 1) NOT NULL ,
[DateAdded] [datetime] NULL ,
[CustomerID] [int] NOT NULL ,
[ProductName] [varchar] (100) NULL ,
[RepID] [int] NULL ,
[QuoteNumber] [varchar] (30) NULL ,
[QuoteDate] [datetime] NULL ,
[QuoteTerm] [varchar] (10) NULL ,
[QuoteFOB] [varchar] (15) NULL ,
[QuoteNAIRep] [varchar] (30) NULL ,
[QuoteExpiration] [datetime] NULL ,
[Note] [varchar] (700) NULL ,
[Comment] [varchar] (1500) NULL ,
[OrderRequirement] [varchar] (1000) NULL ,
[Status] [varchar] (1) NULL ,
[DateClosed] [datetime] NULL ,
[ProductType] [varchar] (30) NULL ,
[ImageID] [int] NULL ,
[CloseMonth] [int] NULL ,
[CloseYear] [int] NULL ,
[ClosePercent] [int] NULL ,
[Segment] [varchar] (50) NULL ,
[AccountID] [uniqueidentifier] NULL ,
[ReplacedQuoteID] [int] NULL ,
[Lead] [varchar] (80) NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Quotes] ADD
CONSTRAINT [DF_Quotes_Closed] DEFAULT ('N') FOR [Status]
GO

CREATE INDEX [idx_RepID] ON [dbo].[Quotes]([RepID]) ON [PRIMARY]
GO

CREATE INDEX [indx_CustomerID] ON [dbo].[Quotes]([CustomerID]) ON [PRIMARY]
GO

CREATE INDEX [indx_QuoteID] ON [dbo].[Quotes]([QuoteID]) ON [PRIMARY]
GO

CREATE INDEX [indx_Status] ON [dbo].[Quotes]([Status]) ON [PRIMARY]
GO

[Comment] [varchar] (1500) NULL , is where I can't enter more than 994 characters.

note - I know very little about SQL, I just had the responsibility placed on me at my job. If this is not enough information to go on to throw an idea at me please let me know what else you need.

Thanks in advanceNo such issue i just ran your script and inserted 1500 characters into the comments column....also when you define 1500 it will give you a capacity of 1500

are you using the insert statement or just entering data through enterprise manager?? cuz insert statement worked fine for me...
insert into quotes (Customerid, comment)
values (3,'Your comment goes here')

Also try to find the length of your largest column by using the following script

select len(comment)
from quotes|||i am entering the text manually. Don't know how to run an insert script.

I ran the sel script and the longest entry is 1000 chars.

would you mind telling me how to run the insert script to apply the comment to quote number 070530JB185438?|||I was able to insert the text I need using the insert script you gave, I just had to add more fields to make it apply to the correct quote...

INSERT INTO Quotes

(QuoteID, CustomerID, QuoteNumber, Comment)

VALUES ('35845', '5695', '070530jb185438', 'comment')

Thanks for the help, it is greatly appreciated.:beer:|||since quoteid is generated automatically you dont need to insert a value there...... according to your table design then customerid is the only non nullable field which needs to be present...

hence for testing purpose if you provide a query as
INSERT INTO Quotes
(CustomerID, Comment)
VALUES ('5695', 'comment')
it would still work...since all other columns are nullable......

Also to test your case you can insert a very long string in place of 'comment'... and inside single quotes of course...

other thing what you can do to test the case is use the update statement
update quotes
set comment = 'You comment goes here'
where customerid = '5695'

this will update the record which has customerid = '5695'
i.e. the record which you have just inserted in the previous post|||Here's a function to insert a 1500 character string of x's into your comment field.

INSERT INTO Quotes
(customerid, comment) VALUES ('1234', REPLACE(SPACE(1500), ' ', 'x'))

then check the length with the Len function

Monday, March 19, 2012

Can't Display Sql 2005 Images

Hi!!!

I have a JPEG image into my Sql Server 2005 DB. The field type in the DB is Image.
When I try to display the image in a report, I always see a red cross instead the image...

I've tried to do: "http://msdn2.microsoft.com/en-us/library/ms156342.aspx" but it doesn't work.

Please help me!!!!

NEStorMake sure the image item source is set to Database. The Product Catalog report included with the RS sample reports demonstrates showing images from the database.

Thursday, March 8, 2012

Can't create trigger

I have a WH table with three primary key: PID, SchYears, Sem.
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
-----
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GOUPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>

Can't create trigger

I have a WH table with three primary key: PID, SchYears, Sem.
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
-----
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GO
UPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>
|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>

Can't create trigger

I have a WH table with three primary key: PID, SchYears, Sem.
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
----
--
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GOUPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> ----
--
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> ----
--
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>

Thursday, February 16, 2012

Cant connect to sql 2000 from client with all field available i.e server ip and port

cant connect to sql server 2000 from c# 2003

Hi,

Could you please post more information on the specific error and conditions? Please take a look at the following guideline:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1

In addition, how are you providing the IP address and Port? As per Books Online the format should be:

tcp:<IP Address>[\instancename],<port>

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.