Showing posts with label write. Show all posts
Showing posts with label write. Show all posts

Thursday, March 22, 2012

Error in using Multi varied parameters!

Hi,

I am tired of troubleshooting this. If I use sa MVP called say states and on the top of the page write

Parameters!orgstate.Value

I get the faSadmiliar "#Error" message. This works fine for any other parameter except MVP.? Anything that i am forgetting to do?

Let me know ASAP if anyone has an idea about this.

Thanks

Because it is a multi-value parameter you are getting back an array of values. You need to do something like:

Parameters!orgstate.Value(0)

-Daniel

|||

Once you mark a parameter as "multi-value", the .Value property will return an object[] with all selected values. If only one value is selected, it will be an object array of length = 1. Object arrays cannot be directly compared with Strings.

To access individual values of a multi value parameter you can use expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert

|||

Thanks Daniel!

Error in using Multi varied parameters!

Hi,

I am tired of troubleshooting this. If I use sa MVP called say states and on the top of the page write

Parameters!orgstate.Value

I get the faSadmiliar "#Error" message. This works fine for any other parameter except MVP.? Anything that i am forgetting to do?

Let me know ASAP if anyone has an idea about this.

Thanks

Because it is a multi-value parameter you are getting back an array of values. You need to do something like:

Parameters!orgstate.Value(0)

-Daniel

|||

Once you mark a parameter as "multi-value", the .Value property will return an object[] with all selected values. If only one value is selected, it will be an object array of length = 1. Object arrays cannot be directly compared with Strings.

To access individual values of a multi value parameter you can use expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert

|||

Thanks Daniel!

Monday, March 19, 2012

Error in sample Northwind?

When I was doing DAO in Access I made sure that my table names did not =
contain any spaces for if they did I had to write my "SQL" statements a =
little differently.
I was following an exmple and had a SQL statment:
sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2" This is in ASP with =
Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. =
But if you go to the tables in the Northwind database in SQL 2000 it is =
shown as Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. =
So what I am wondering is when tables in SQL 2000 contain spaces like =
the above Order Deatails, is the SQL statement as I have written it =
irrelevant? Shouldn't it be:
sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2"
?
Thanks.
--=20
George Hester
__________________________________
Hi,
Use SQARE brackets [] incase if you have space inbetwen the object names.
sSQL1 = "UPDATE [Order Details] SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
Thanks
Hari
MCDBA
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:e#lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not
contain any spaces for if they did I had to write my "SQL" statements a
little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
This is in ASP with Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But
if you go to the tables in the Northwind database in SQL 2000 it is shown as
Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. So
what I am wondering is when tables in SQL 2000 contain spaces like the above
Order Deatails, is the SQL statement as I have written it irrelevant?
Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
?
Thanks.
George Hester
__________________________________
|||The ANSI SQL compliant way is to enclose the name inside double-quotes. SQL Server also support square
brackets. I prefer the ANSI SQL Compliant way.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not contain any spaces for if they did I
had to write my "SQL" statements a little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2" This is in ASP with
Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But if you go to the tables in the
Northwind database in SQL 2000 it is shown as Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. So what I am wondering is when tables
in SQL 2000 contain spaces like the above Order Deatails, is the SQL statement as I have written it
irrelevant? Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
?
Thanks.
George Hester
__________________________________
|||OK then it would be:
sSQL1 =3D "UPDATE ""Order Details"" SET Quantity=3D5 WHERE OrderID=3D3 =
AND ProductID=3D2"
for VBScript?
--=20
George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote =
in message news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside =
double-quotes. SQL Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
>=20
> --=20
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>=20
>=20
> "George Hester" <hesterloli@.hotmail.com> wrote in message =
news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not =
contain any spaces for if they did I
> had to write my "SQL" statements a little differently.
>=20
> I was following an exmple and had a SQL statment:
>=20
> sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
>=20
> Anyway if you look at this statement the table is called OrderDetails. =
But if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the =
space.
>=20
> This is the only table in the Northwind database that conatins a =
space. So what I am wondering is when tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL =
statement as I have written it
> irrelevant? Shouldn't it be:
>=20
> sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 =
AND ProductID=3D2"
> ?
> Thanks.
>=20
> --=20
> George Hester
> __________________________________
>=20
>
|||Yep. Better yet, always quality the object name with the owner. :-)
UPDATE dbo."Order Details" SET...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:ujt2XRFQEHA.3220@.TK2MSFTNGP09.phx.gbl...
OK then it would be:
sSQL1 = "UPDATE ""Order Details"" SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
for VBScript?
George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside double-quotes. SQL Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not contain any spaces for if they did I
> had to write my "SQL" statements a little differently.
> I was following an exmple and had a SQL statment:
> sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
> Anyway if you look at this statement the table is called OrderDetails. But if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the space.
> This is the only table in the Northwind database that conatins a space. So what I am wondering is when
tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL statement as I have written it
> irrelevant? Shouldn't it be:
> sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
> ?
> Thanks.
> --
> George Hester
> __________________________________
>

Error in sample Northwind?

When I was doing DAO in Access I made sure that my table names did not = contain any spaces for if they did I had to write my "SQL" statements a = little differently.
I was following an exmple and had a SQL statment:
sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND = ProductID=3D2" This is in ASP with = Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. = But if you go to the tables in the Northwind database in SQL 2000 it is = shown as Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. = So what I am wondering is when tables in SQL 2000 contain spaces like = the above Order Deatails, is the SQL statement as I have written it = irrelevant? Shouldn't it be:
sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 AND = ProductID=3D2"
?
Thanks.
-- George Hester
__________________________________Hi,
Use SQARE brackets [] incase if you have space inbetwen the object names.
sSQL1 = "UPDATE [Order Details] SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
Thanks
Hari
MCDBA
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:e#lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not
contain any spaces for if they did I had to write my "SQL" statements a
little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
This is in ASP with Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But
if you go to the tables in the Northwind database in SQL 2000 it is shown as
Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. So
what I am wondering is when tables in SQL 2000 contain spaces like the above
Order Deatails, is the SQL statement as I have written it irrelevant?
Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
?
Thanks.
--
George Hester
__________________________________|||The ANSI SQL compliant way is to enclose the name inside double-quotes. SQL Server also support square
brackets. I prefer the ANSI SQL Compliant way.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not contain any spaces for if they did I
had to write my "SQL" statements a little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2" This is in ASP with
Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But if you go to the tables in the
Northwind database in SQL 2000 it is shown as Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. So what I am wondering is when tables
in SQL 2000 contain spaces like the above Order Deatails, is the SQL statement as I have written it
irrelevant? Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
?
Thanks.
--
George Hester
__________________________________|||OK then it would be:
sSQL1 =3D "UPDATE ""Order Details"" SET Quantity=3D5 WHERE OrderID=3D3 =AND ProductID=3D2"
for VBScript?
-- George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote =in message news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside =double-quotes. SQL Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
> > -- > Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message =news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not =contain any spaces for if they did I
> had to write my "SQL" statements a little differently.
> > I was following an exmple and had a SQL statment:
> > sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND =ProductID=3D2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
> > Anyway if you look at this statement the table is called OrderDetails. = But if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the =space.
> > This is the only table in the Northwind database that conatins a =space. So what I am wondering is when tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL =statement as I have written it
> irrelevant? Shouldn't it be:
> > sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 =AND ProductID=3D2"
> ?
> Thanks.
> > -- > George Hester
> __________________________________
> >|||Yep. Better yet, always quality the object name with the owner. :-)
UPDATE dbo."Order Details" SET...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:ujt2XRFQEHA.3220@.TK2MSFTNGP09.phx.gbl...
OK then it would be:
sSQL1 = "UPDATE ""Order Details"" SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
for VBScript?
--
George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside double-quotes. SQL Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not contain any spaces for if they did I
> had to write my "SQL" statements a little differently.
> I was following an exmple and had a SQL statment:
> sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
> Anyway if you look at this statement the table is called OrderDetails. But if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the space.
> This is the only table in the Northwind database that conatins a space. So what I am wondering is when
tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL statement as I have written it
> irrelevant? Shouldn't it be:
> sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
> ?
> Thanks.
> --
> George Hester
> __________________________________
>

Error in sample Northwind?

When I was doing DAO in Access I made sure that my table names did not =
contain any spaces for if they did I had to write my "SQL" statements a =
little differently.
I was following an exmple and had a SQL statment:
sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2" This is in ASP with =
Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. =
But if you go to the tables in the Northwind database in SQL 2000 it is =
shown as Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. =
So what I am wondering is when tables in SQL 2000 contain spaces like =
the above Order Deatails, is the SQL statement as I have written it =
irrelevant? Shouldn't it be:
sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2"
?
Thanks.
--=20
George Hester
__________________________________Hi,
Use SQARE brackets [] incase if you have space inbetwen the object names
.
sSQL1 = "UPDATE [Order Details] SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
Thanks
Hari
MCDBA
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:e#lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not
contain any spaces for if they did I had to write my "SQL" statements a
little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
This is in ASP with Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But
if you go to the tables in the Northwind database in SQL 2000 it is shown as
Order Details. Note the space.
This is the only table in the Northwind database that conatins a space. So
what I am wondering is when tables in SQL 2000 contain spaces like the above
Order Deatails, is the SQL statement as I have written it irrelevant?
Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND
ProductID=2"
?
Thanks.
George Hester
__________________________________|||The ANSI SQL compliant way is to enclose the name inside double-quotes. SQL
Server also support square
brackets. I prefer the ANSI SQL Compliant way.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPEHA
.2128@.TK2MSFTNGP11.phx.gbl...
When I was doing DAO in Access I made sure that my table names did not conta
in any spaces for if they did I
had to write my "SQL" statements a little differently.
I was following an exmple and had a SQL statment:
sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=2"
This is in ASP with
Server.CreateObject("ADODB.Connection")
Anyway if you look at this statement the table is called OrderDetails. But
if you go to the tables in the
Northwind database in SQL 2000 it is shown as Order Details. Note the space
.
This is the only table in the Northwind database that conatins a space. So
what I am wondering is when tables
in SQL 2000 contain spaces like the above Order Deatails, is the SQL stateme
nt as I have written it
irrelevant? Shouldn't it be:
sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND ProductID
=2"
?
Thanks.
George Hester
__________________________________|||OK then it would be:
sSQL1 =3D "UPDATE ""Order Details"" SET Quantity=3D5 WHERE OrderID=3D3 =
AND ProductID=3D2"
for VBScript?
--=20
George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote =
in message news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside =
double-quotes. SQL Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
>=20
> --=20
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>=20
>=20
> "George Hester" <hesterloli@.hotmail.com> wrote in message =
news:e%23lSISoPEHA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not =
contain any spaces for if they did I
> had to write my "SQL" statements a little differently.
>=20
> I was following an exmple and had a SQL statment:
>=20
> sSQL1 =3D "UPDATE OrderDetails SET Quantity=3D5 WHERE OrderID=3D3 AND =
ProductID=3D2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
>=20
> Anyway if you look at this statement the table is called OrderDetails. =
But if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the =
space.
>=20
> This is the only table in the Northwind database that conatins a =
space. So what I am wondering is when tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL =
statement as I have written it
> irrelevant? Shouldn't it be:
>=20
> sSQL1 =3D "UPDATE 'Order Details' SET Quantity=3D5 WHERE OrderID=3D3 =
AND ProductID=3D2"
> ?
> Thanks.
>=20
> --=20
> George Hester
> __________________________________
>=20
>|||Yep. Better yet, always quality the object name with the owner. :-)
UPDATE dbo."Order Details" SET...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message news:ujt2XRFQEHA.3
220@.TK2MSFTNGP09.phx.gbl...
OK then it would be:
sSQL1 = "UPDATE ""Order Details"" SET Quantity=5 WHERE OrderID=3 AND Product
ID=2"
for VBScript?
George Hester
__________________________________
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message
news:e519lOxPEHA.1644@.TK2MSFTNGP09.phx.gbl...
> The ANSI SQL compliant way is to enclose the name inside double-quotes. SQ
L Server also support square
> brackets. I prefer the ANSI SQL Compliant way.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Hester" <hesterloli@.hotmail.com> wrote in message news:e%23lSISoPE
HA.2128@.TK2MSFTNGP11.phx.gbl...
> When I was doing DAO in Access I made sure that my table names did not con
tain any spaces for if they did I
> had to write my "SQL" statements a little differently.
> I was following an exmple and had a SQL statment:
> sSQL1 = "UPDATE OrderDetails SET Quantity=5 WHERE OrderID=3 AND ProductID=
2" This is in ASP with
> Server.CreateObject("ADODB.Connection")
> Anyway if you look at this statement the table is called OrderDetails. Bu
t if you go to the tables in the
> Northwind database in SQL 2000 it is shown as Order Details. Note the spa
ce.
> This is the only table in the Northwind database that conatins a space. So what I
am wondering is when
tables
> in SQL 2000 contain spaces like the above Order Deatails, is the SQL state
ment as I have written it
> irrelevant? Shouldn't it be:
> sSQL1 = "UPDATE 'Order Details' SET Quantity=5 WHERE OrderID=3 AND Product
ID=2"
> ?
> Thanks.
> --
> George Hester
> __________________________________
>

Sunday, March 11, 2012

Error in olap report

I am trying to write an olap report using RS2005. I created a datasource
with type "Microsoft Analysis Services" then added a report and defined
measures and dimensions in the query builder. Report is working fine but if
I make any modification, I will not be able to save the report and as soon
as I switch to any other tab (for example click on Preview tab or Data tab)
I will get the error "Microsoft Visual Studio has encountered a problem and
needs to close." I tried same senario by using "Analysis Services Toturial"
cube and I got same result.
Any idea?
Thanks.Actually, I'm used to getting this if I stress my development computer too
much... For bigger reports based on OLAP cubes, I just don't use the preview
function. I tweak my MDX query to just return enough data for the fields to
fill up right, and then I just save as quickly as possible. If you just add
a =" to the beginning of your query and a " at the end and make it be one
long string (no new lines), you will be able to save without the report
going to pieces. Remeber to use the "Save all" button after having added a
new report to your solution, or it will not be saved with your solution.
(But it will be available through "Add existing item".)
Not sure if this is what you wanted to hear, but it might save you from some
frustration.
Kaisa
"Tooraj" <abc@.abc.com> wrote in message
news:uEmibczBGHA.984@.tk2msftngp13.phx.gbl...
>I am trying to write an olap report using RS2005. I created a datasource
>with type "Microsoft Analysis Services" then added a report and defined
>measures and dimensions in the query builder. Report is working fine but if
>I make any modification, I will not be able to save the report and as soon
>as I switch to any other tab (for example click on Preview tab or Data tab)
>I will get the error "Microsoft Visual Studio has encountered a problem and
>needs to close." I tried same senario by using "Analysis Services Toturial"
>cube and I got same result.
> Any idea?
> Thanks.
>

Wednesday, March 7, 2012

Error in formula any help please

i am trying to write a double expression to return a count of sales
orders when they are from "uk" and status is "good"
=SUM((IIf((Fields!locale.Value) = "uk",1,0)),IIf(Fields!
Status_name.Value ="Good",1,0))
but get an error
The scope parameter must be set to a string constant that is equal to
either the name of a containing group, the name of a containing data
region, or the name of a data set#
any help please my formula looks correct'
thanks in advanceignore me it was a simple error i needed and "and" not a ","
thanks anyway

Friday, February 24, 2012

Error in convert function

I use convert to work with Hijri functions
when i write
select convert (datetime,'29-10-1426',131)
the result is correct
2005-12-01 00:00:00.000

when I increase the date by one
select convert (datetime,'30-10-1426',131)
I get
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Why and how i solve itAs far as I know, the month 10 in Hijri calendar only has 29 days, so the second statement is supposed to fail. The next day to convert (datetime,'30-10-1426',131) is

select convert (datetime,'1-11-1426',131)

Regards,
Jun|||

The 10 month in Hijri calender is 30 days so
In Hijri calender any month can be 29 or 30 days
thanks

Error in building SQL query within "LIKE" statement for TableAdapter in Design Section

ASP.net 2.0 (VB), SQL Server 2005:

While creating a new TableAdapter in design section, I'm using the query builder and trying to write a query within "LIKE" statement as below -

Example1: SELECT * FROM table WHERE field LIKE @.'%TextBoxData%'
Example2: SELECT * FROM table WHERE field LIKE'%@.TextBoxData%'

but these query doesn't work...error in building query...any clue to make it work? If I remove "@." sure the query will work with normal but '%TextBoxData%' will become a hardcoding value...this is not I want...I want make the TextBoxData become a flexible value depend on the data what I enter in my text box like 'abc,123' not like 'TextBoxData'...

I know normally it supposed to be like:

"SELECT * FROM table WHERE field LIKE'%" & TextBoxData.Text & "%'"


It can work when inCode Section, but not at this time...because now i'm trying to made it with "Query Builder" for TableAdapter " inDesign Section...hmm did you get what I mean? Sorry for my bad english

Thanks in advance

Hi, you can use such query which should beinterpreted correctly as T-SQL command:

SELECT * FROM table WHERE field LIKE '%'+TextBoxData+'%'

|||

Nice work, how thanksIori_Jay, you are the manBig Smile

|||It Should be'%'+@.TextBoxData+'%'