Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Thursday, March 29, 2012

Error: CrystalDecisions.CrystalReports.Engine.FormulaException: Error in File C:\DOCUME~1\

Hello,

I am having a crystal report using datastored in a dataset. When I select one of items in a dropdownlist, it gives me this error message. Note that I used that code before in another web page using a different crystal report and a different dataSet and it worked successfully, but this time it doesn't work...anyone can tell me what causes this error and how to solve it?

NOTE: I am using a vb code behind in my .aspx page

Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt: Error in formula <Record_Selection>. '{StProd2.ItemDescription}' The result of selection formula must be a boolean.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:CrystalDecisions.CrystalReports.Engine.FormulaException: Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt: Error in formula <Record_Selection>. '{StProd2.ItemDescription}' The result of selection formula must be a boolean.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[FormulaException: Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt:Error in formula <Record_Selection>. '{StProd2.ItemDescription}'The result of selection formula must be a boolean.]  . F(String  , EngineExceptionErrorID  )  . A(Int16   , Int32   )  . @.(Int16  ) CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) CrystalDecisions.Web.ReportAgent.u(Boolean  N) CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Page.ProcessRequestMain()

Dear Frnd',

It will nice if you provied more info, like in drop you are selecting which report to get or some value on which parameter it get the dataset.

or what are the datatype in database & on report.

Some more detail need to get it root.

Tuesday, March 27, 2012

Error: Command not properly ended

Hi there,
Would appreciate if someone can have a glance at this code, and tell me
what SQL Talk doesnt like about it?
SELECT X, Y, Z, A, B FROM TSECURITY_LEVEL INTO :x, :y, :z, :a, :b
WHERE 1=1 ORDER BY A;
^
Error: Command not properly ended
Thanks All,
SamSam
SELECT <columns list> INTO #Test FROM MyTable WHERE blabalabala
"Sam" <sammA11111@.hotmail.com> wrote in message
news:1132738877.588734.57500@.g49g2000cwa.googlegroups.com...
> Hi there,
> Would appreciate if someone can have a glance at this code, and tell me
> what SQL Talk doesnt like about it?
> SELECT X, Y, Z, A, B FROM TSECURITY_LEVEL INTO :x, :y, :z, :a, :b
> WHERE 1=1 ORDER BY A;
> ^
> Error: Command not properly ended
> Thanks All,
> Sam
>|||Thanks for the reply Uri.
rookie mistake, and the problem is sorted ;)
samsql

Friday, March 9, 2012

error,again

tentaively, got:
create #table(a,b,c,d)
insert into #table
select A,B,C,D
from s,t,x,y,z where y.price > 20

select *,
(select max(D) from
(select distinct top 2 with ties from #temp v where
v.B=W.B and v.C = W.c),
(select min(D) from
(select distinct top 2 with ties from #temp v where
v.B=W.B and v.C = W.c)
from #temp w
drop Table #temp

This works, but if y.price > 20 condition is not met,
unsupported error message gets produced within crystal
report. i expected blank field report instead in this
case,

included If exists around the select statement ,
still same error.

BTW, is there a way to find max(D) and min(D),
two highests, can be improved?.

--
Sent by 3 from yahoo subdomain of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.comalexqa2003@.yahoo.com (u128845214@.spawnkill.ip-mobilphone.net) writes:
> tentaively, got:
> create #table(a,b,c,d)
> insert into #table
> select A,B,C,D
> from s,t,x,y,z where y.price > 20
> select *,
> (select max(D) from
> (select distinct top 2 with ties from #temp v where
> v.B=W.B and v.C = W.c),
> (select min(D) from
> (select distinct top 2 with ties from #temp v where
> v.B=W.B and v.C = W.c)
> from #temp w
> drop Table #temp
> This works, but if y.price > 20 condition is not met,
> unsupported error message gets produced within crystal
> report. i expected blank field report instead in this
> case,

If the condition is not met, the temp table is empty, and you will
get no rows back at all.

You could do:

IF EXISTS (SELECT * FROM #temp)
SELECT *, ...
ELSE
SELECT NULL, NULL, NULL, NULL, NULL, NULL -- As many as needed.

Although, it would be better to rewrite the report to handle an
empty result set...

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

error,again

tentaively, got:
create #table(a,b,c,d)
insert into #table
select A,B,C,D
from s,t,x,y,z where y.price > 20
select *,
(select max(D) from
(select distinct top 2 with ties from #temp v where
v.B=W.B and v.C = W.c),
(select min(D) from
(select distinct top 2 with ties from #temp v where
v.B=W.B and v.C = W.c)
from #temp w
drop Table #temp
This works, but if y.price > 20 condition is not met,
unsupported error message gets produced within crystal
report. i expected blank field report instead in this
case,
included If exists around the select statement ,
still same error.
BTW, is there a way to find max(D) and min(D),
two highests, can be improved?.
--
Sent by 3 from yahoo subdomain of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.comalexqa2003@.yahoo.com (u128845214@.spawnkill.ip-mobilphone.net) writes:
> tentaively, got:
> create #table(a,b,c,d)
> insert into #table
> select A,B,C,D
> from s,t,x,y,z where y.price > 20
> select *,
> (select max(D) from
> (select distinct top 2 with ties from #temp v where
> v.B=W.B and v.C = W.c),
> (select min(D) from
> (select distinct top 2 with ties from #temp v where
> v.B=W.B and v.C = W.c)
> from #temp w
> drop Table #temp
> This works, but if y.price > 20 condition is not met,
> unsupported error message gets produced within crystal
> report. i expected blank field report instead in this
> case,
If the condition is not met, the temp table is empty, and you will
get no rows back at all.
You could do:
IF EXISTS (SELECT * FROM #temp)
SELECT *, ...
ELSE
SELECT NULL, NULL, NULL, NULL, NULL, NULL -- As many as needed.
Although, it would be better to rewrite the report to handle an
empty result set...
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

error(2)

create #table(A nvarchar(30), B nvarchar(20), c
nvarchar(15), D int)
insert into #table
select a,b,c,d
from x,y,z where c like 'Norm%'
group by a,b,c,d
create #table(class,name, exam,score) as:
A name1 math 100
A name1 math 88
A name1 Phy 98
A name1 Chm 98
A name1 SPT 89
A name2 math 54
A name2 math 79
A name2 Phy 79
A name2 Chm 44
A name2 SPT 34
B name1 math 54
B name1 math 23
B name1 Phy 54
B name1 Chm 98
B name1 SPT 89
B name2 math 35
B name2 math 35
B name2 Phy 33
B name2 Chm 66
B name2 SPT 12
Finding max(score) for exam started with 'm'
grouped by class and name.
select *,
(select max(result) from #table T where T.class = D.class and
T.name = D.name and T.exame like 'm%' ) as mx
from #table D
DROP TABLE #table
GO
NOw, if there is no data inserted into #table , got:
not supported error message otherwise it works OK.
Do not like to get this error message when no data
is inserted into #table. how?.
If exists(select *,
(select max(result) from #table T where T.class = D.class and
T.name = D.name and T.exame like 'm%' ) as mx
from #table D)
Did not resolve it.
--
Sent by from yahoo subdomain of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.comu359375000@.spawnkill.ip-mobilphone.net (alexsql2000@.yahoo.com) wrote in message news:<l.1066087533.1806060791@.[63.127.215.130]>...
> create #table(A nvarchar(30), B nvarchar(20), c
> nvarchar(15), D int)
> insert into #table
> select a,b,c,d
> from x,y,z where c like 'Norm%'
> group by a,b,c,d
>
> create #table(class,name, exam,score) as:
> A name1 math 100
> A name1 math 88
> A name1 Phy 98
> A name1 Chm 98
> A name1 SPT 89
> A name2 math 54
> A name2 math 79
> A name2 Phy 79
> A name2 Chm 44
> A name2 SPT 34
> B name1 math 54
> B name1 math 23
> B name1 Phy 54
> B name1 Chm 98
> B name1 SPT 89
> B name2 math 35
> B name2 math 35
> B name2 Phy 33
> B name2 Chm 66
> B name2 SPT 12
> Finding max(score) for exam started with 'm'
> grouped by class and name.
> select *,
> (select max(result) from #table T where T.class => D.class and
> T.name = D.name and T.exame like 'm%' ) as mx
> from #table D
> DROP TABLE #table
> GO
>
> NOw, if there is no data inserted into #table , got:
> not supported error message otherwise it works OK.
> Do not like to get this error message when no data
> is inserted into #table. how?.
> If exists(select *,
> (select max(result) from #table T where T.class => D.class and
> T.name = D.name and T.exame like 'm%' ) as mx
> from #table D)
> Did not resolve it.
Your explanation isn't completely clear (your query doesn't match your
column names, and you don't give the exact error message you're
getting), but it looks like this should simply work:
select class, name, exam, max(score)
from #table
where exam like 'm%'
group by class, name, exam
If this isn't what you need, then consider posting working CREATE
TABLE statements, along with INSERTs to add your sample data, and the
output you expect.
Simon|||Hi
The following are untested by you may want to try:
If exists(select * from #table T where T.exame like 'm%' )
select *, (select max(T.result)
from #table T
where T.class = D.class
and T.name = D.name
and exame like 'm%' ) as mx
from #table D
Or try the following without the check:
select D.*, T.Mx
from #table D JOIN
(select Class, Name, max(result) as MX
from #table
WHERE exame like 'm%'
GROUP BY Class, Name ) T ON T.class = D.class
and T.name = D.name
WHERE D.exame like 'm%'
John
"alexsql2000@.yahoo.com" <u359375000@.spawnkill.ip-mobilphone.net> wrote in
message news:l.1066087533.1806060791@.[63.127.215.130]...
> create #table(A nvarchar(30), B nvarchar(20), c
> nvarchar(15), D int)
> insert into #table
> select a,b,c,d
> from x,y,z where c like 'Norm%'
> group by a,b,c,d
>
> create #table(class,name, exam,score) as:
> A name1 math 100
> A name1 math 88
> A name1 Phy 98
> A name1 Chm 98
> A name1 SPT 89
> A name2 math 54
> A name2 math 79
> A name2 Phy 79
> A name2 Chm 44
> A name2 SPT 34
> B name1 math 54
> B name1 math 23
> B name1 Phy 54
> B name1 Chm 98
> B name1 SPT 89
> B name2 math 35
> B name2 math 35
> B name2 Phy 33
> B name2 Chm 66
> B name2 SPT 12
> Finding max(score) for exam started with 'm'
> grouped by class and name.
> select *,
> (select max(result) from #table T where T.class => D.class and
> T.name = D.name and T.exame like 'm%' ) as mx
> from #table D
> DROP TABLE #table
> GO
>
> NOw, if there is no data inserted into #table , got:
> not supported error message otherwise it works OK.
> Do not like to get this error message when no data
> is inserted into #table. how?.
> If exists(select *,
> (select max(result) from #table T where T.class => D.class and
> T.name = D.name and T.exame like 'm%' ) as mx
> from #table D)
> Did not resolve it.
>
>
> --
> Sent by from yahoo subdomain of com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com

Wednesday, March 7, 2012

Error with Select Statement using the SQLDataAdapter Wizard

Error with Select Statement using the SQLDataAdapter Wizard
------------------------

I am needing to setup the data adapter for my SQL database for use with a web page that submits employment applications. When using the wizard I get this error: Incorrect syntax near the keyword 'FROM'. Beings that the code is generated by VB I am confused what would be incorrect. If anyone can see the problem please let me know. THANKS!

Here is the code that is giving me the error:

SELECT
FROM
[Personal Info] INNER
JOIN
Education ON
[Personal Info].[Applicants SSN] = Education.[Applicants SSN] INNER JOIN Legal ON [Personal Info].[Applicants SSN] = Legal.[Applicants SSN] INNER JOIN [Military Service] ON [Personal Info].[Applicants SSN] = [Military Service].[Applicants SSN] INNER JOIN [Employment History] ON [Personal Info].[Applicants SSN] = [Employment History].[Applicants SSN] INNER JOIN [References] ON [Personal Info].[Applicants SSN] = [References].[Applicants SSN] INNER JOIN [Farm Preference] ON [Personal Info].[Applicants SSN] = [Farm Preference].[Applicants SSN]

Quote:

Originally Posted by sds50

Error with Select Statement using the SQLDataAdapter Wizard
------------------------

I am needing to setup the data adapter for my SQL database for use with a web page that submits employment applications. When using the wizard I get this error: Incorrect syntax near the keyword 'FROM'. Beings that the code is generated by VB I am confused what would be incorrect. If anyone can see the problem please let me know. THANKS!

Here is the code that is giving me the error:

SELECT
FROM
[Personal Info] INNER
JOIN
Education ON
[Personal Info].[Applicants SSN] = Education.[Applicants SSN] INNER JOIN Legal ON [Personal Info].[Applicants SSN] = Legal.[Applicants SSN] INNER JOIN [Military Service] ON [Personal Info].[Applicants SSN] = [Military Service].[Applicants SSN] INNER JOIN [Employment History] ON [Personal Info].[Applicants SSN] = [Employment History].[Applicants SSN] INNER JOIN [References] ON [Personal Info].[Applicants SSN] = [References].[Applicants SSN] INNER JOIN [Farm Preference] ON [Personal Info].[Applicants SSN] = [Farm Preference].[Applicants SSN]


You haven't selected anything. You should have:

SELECT field1,field2 ... etc
FROM ...

Error with Openrowset

I have a text file, that I need to import to SQL. I am trying to do this using OPENROWSET. This is the qry i use below.

select * from OpenRowset('MSDASQL',
'Driver={Microsoft Text Driver
(*.txt; *.csv)};
DefaultDir=c:\edge;',
'select * from
vwConstrLendingLoanDefiDetailReady.txt')

I have created a System DSN, For the microsoft text driver. Anyhow it throws this error:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].

Any idea why?

If this is in SQL 2005

Go to Surface Area Configuration->Surface Area Configuration for Features
Database Engine->Ad Hoc Remote Queries
Make sure 'Enable OPENROWSET and OPENDATASOURCE Support' is checked.|||It is SQL SERVER 2000. I have used Openrowset while connecting to other dbs like SQL Server etc...|||i FOUND THE Fix. I had an extra space, in mjy qry. Fixed that and it was able to execute the qry, and return the data.

Error with ole db

I created a view refer to a visual foxpro with ole db for visual foxpro which was working fine before. But now, I received an error while select the view

Msg 7302, Level 16, State 1, Line 1
Cannot create an instance of OLE DB provider "VFPOLEDB" for linked server "ORST3".

Please advise. Thanks in advance


Can you provide us with sample repro code for this issue?

Thanks

Sunday, February 26, 2012

error with c# select statement

hi i have copied this from my other page where it works fine and i cant understand what is going wrong! maybe one of your guys can point out what i cant see! herei s my code

string strOrderID = Request.QueryString["orderID"].ToString();

int intOrderID =Convert.ToInt32(strOrderID);

int intCustID =Convert.ToInt32(Request.QueryString["qsnOrderCustID"].ToString());

lblCustomerID.Text = Request.QueryString["qsnOrderCustID"].ToString();lblOrderID.Text = Request.QueryString["orderID"].ToString();

SqlConnection myConn =newSqlConnection("Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx");

//This is the sql statement.

string sql ="SELECT [del_address], [del_post_code], [del_time] From tbl_del WHERE order_ID = " + intOrderID;

//This creates a sql command which executes the sql statement.

SqlCommand sqlCmd =newSqlCommand(sql, myConn);

myConn.Open();

SqlDataReader dr = sqlCmd.ExecuteReader();

//This reads the first result from the sqlReader

dr.Read();

try

{

lblDelTime.Text =Convert.ToString(dr["del_time"].ToString);

lblDelAddy.Text = dr["del_address"].ToString();

lblDelPCode.Text = dr["del_post_code"].ToString();if (lblDelAddy.Text !="")

{

lblDelDate.Visible =true;

lblDelTime.Visible =true;

Label1.Visible =true;

Label2.Visible =true;

}

}

catch (Exception except)

{

lblerror.Text =Convert.ToString(except);

}

Regards

Jez

What error are you getting?

|||

try

{

lblDelTime.Text =Convert.ToString(dr["del_time"].ToString);

lblDelAddy.Text = dr["del_address"].ToString();

lblDelPCode.Text = dr["del_post_code"].ToString();if (lblDelAddy.Text !="")

{

lblDelDate.Visible =true;

lblDelTime.Visible =true;

Label1.Visible =true;Label2.Visible =true;

}

}

catch (Exception except)

{

lblerror.Text =Convert.ToString(except);

}

I can only find the above problem in the code...if you can name the error it will be more helpful for us.

|||

i realised that i was being a complete idiot (thats what being up for to long does! makes you miss the obvious!) i took a look at the bigger picture, it said that the textbox wasnt being filled, so maybe a problem with the data reader, no, but because i have 2 data readers on one page and i just copied and pasted the code, i forgot to put dr2[" instead of dr["

Wednesday, February 15, 2012

Error while Creating table using Select Command

Hi All,

I am new to MS SQL Server.I am using MS SQL 2000.I have a problem in
creating a table by using Select command.I have table called "test"
and i want to create another table with the same structure and rows.I
tried with the following command

create Table test1 as select * from test;

But it give an syntax error.I have tried the same command in Oracle
but i was working.Does MS SQL 2000 Server supports this kind of Query.

Please help me to solve the problem or any other methods to perform
this operation.

Thanks in Advance

KevinYou can use Query Analyzer to generate the CREATE TABLE statement
automatically from your exsiting table.

CREATE TABLE test1 (col1 INTEGER PRIMARY KEY, col2...)

INSERT INTO test1 (col1, col2,...)
SELECT col1, col2,...
FROM test

You can also use:

SELECT * INTO test1 FROM test

but the CREATE... INSERT method gives you more control over constraints,
etc.

--
David Portas
----
Please reply only to the newsgroup
--|||SELECT * INTO NewTable FROM OldTable

This will create the same structure and take the data with it.

The other option is go to the design of your table, preview a script
of it, and then use this to build the new table (just change the table
name). Once you have the structure of the table, you can create / drop
this as needed within your query (i.e. Create Table ... SELECT
INTO...)

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message news:<hrOdnSkox9Ft2CaiRVn-vg@.giganews.com>...
> You can use Query Analyzer to generate the CREATE TABLE statement
> automatically from your exsiting table.
> CREATE TABLE test1 (col1 INTEGER PRIMARY KEY, col2...)
> INSERT INTO test1 (col1, col2,...)
> SELECT col1, col2,...
> FROM test
> You can also use:
> SELECT * INTO test1 FROM test
> but the CREATE... INSERT method gives you more control over constraints,
> etc.