Showing posts with label col3. Show all posts
Showing posts with label col3. Show all posts

Wednesday, March 28, 2012

Please help deciphering error message

I just changed my dataset syntaxes from the typical
SELECT col FROM table WHERE col3 = @.value
to
="SELECT col FROM table WHERE col3 = '" & Parameters!Code.Value & "'
For some reason I'm getting the following pop-up:
--
Processing Errors
--
An error has occurred during report processing.
Cannot set the command text for data set 'ds_Legal_Entity'.
Error during processing of the CommandText expression of dataset
â'ds_Legal_Entityâ'.
--
OK
--
I am not familiar with the CommandText syntax to understand where the error
might be. My query is below, could someone tell me what the problem might be?
Thanks!
Mike
="SELECT DISTINCT dbo.t_d_legal.legal_desc
FROM dbo.t_d_legal
INNER JOIN dbo.t_pms ON dbo.t_d_legal.legal_key = dbo.t_pms.legal_key
WHERE (dbo.t_pms.mth_key = " & Parameters!mth_key.Value & ") " &
IIF(Parameters!BusKey.Value = 0,"","
AND
(dbo.t_pms.bus_key = ") & Parameters!BusKey.Value & ")" &
" ORDER BY dbo.t_d_legal.legal_desc"think you had extra single quote:
="SELECT col FROM table WHERE col3 = " & Parameters!Code.Value & " rest of
code"
otherwise if you need quotes due to your parm value being character you'll
need to double up on the quotes. read BOL.
"Bassist695" wrote:
> I just changed my dataset syntaxes from the typical
> SELECT col FROM table WHERE col3 = @.value
> to
> ="SELECT col FROM table WHERE col3 = '" & Parameters!Code.Value & "'
> For some reason I'm getting the following pop-up:
> --
> Processing Errors
> --
> An error has occurred during report processing.
> Cannot set the command text for data set 'ds_Legal_Entity'.
> Error during processing of the CommandText expression of dataset
> â'ds_Legal_Entityâ'.
> --
> OK
> --
> I am not familiar with the CommandText syntax to understand where the error
> might be. My query is below, could someone tell me what the problem might be?
> Thanks!
> Mike
> ="SELECT DISTINCT dbo.t_d_legal.legal_desc
> FROM dbo.t_d_legal
> INNER JOIN dbo.t_pms ON dbo.t_d_legal.legal_key = dbo.t_pms.legal_key
> WHERE (dbo.t_pms.mth_key = " & Parameters!mth_key.Value & ") " &
> IIF(Parameters!BusKey.Value = 0,"","
> AND
> (dbo.t_pms.bus_key = ") & Parameters!BusKey.Value & ")" &
> " ORDER BY dbo.t_d_legal.legal_desc"

Monday, March 26, 2012

please help

if i query like
select * from table1 then i will get the following
************************************************** **
Ticker col2 col3 col4 col5
----------------
BRK.A2003-05-02 70400.000.0078500.00
FARM2003-05-02 326.253.60370.99
GREY2003-05-02 680.004.00832.00
----------------------
BRK.A2003-05-09 72700.000.0078500.00
FARM2003-05-09 313.003.60370.99
GREY2003-05-09 655.004.00832.00
----------------------
BRK.A2003-05-16 73550.000.0078500.00
FARM2003-05-16 311.503.60370.99
GREY2003-05-16 649.904.00832.00
-----------------------
BRK.A2003-05-23 73850.010.0077000.00
FARM2003-05-23 317.253.60370.99
GREY2003-05-23 665.004.00832.00
-----------------------
BRK.A2003-05-30 71000.000.0075900.00
FARM2003-05-30 322.003.60370.99
GREY2003-05-30 657.004.00832.00

************************************************** **

but my output should be as follows
***********************************************
Ticker Item 5/2/2003 5/9/2003 5/16/2003 5/23/2003 5/30/2003
----------------------
BRK.A col3 70400.00 72700.00 73550.00 73850.01 71000.00
col4 0.00 0.00 0.00 0.00 0.00
col5 78500.00 78500.00 78500.00 77000.00 75900.00
----------------------
FARM col3 326.25 313.00 311.50 317.25 322.00
col4 3.60 3.60 3.60 3.60 3.60
col5 370.99 370.99 370.99 370.99 370.99
----------------------
GREY col3 680.00 655.00 649.90 665.00 657.00
col4 4.00 4.00 4.00 4.00 4.00
col5 832.00 832.00 832.00 832.00 832.00

**********************************************
can anyone helpme how 2 create the query in order 2 obtain the required outputHi

It looks like you are wanting a pivot table. It is usually better to do this
on the client.
If you don't want to write the code to do it then something like
http://www.rac4sql.net/ can be used.

You can also do in the database, but these may be slow:
http://support.microsoft.com/defaul...b;EN-US;q175574

http://www.sqlteam.com/item.asp?ItemID=2955

John

"kalyan" <kalikoi@.yahoo.com> wrote in message
news:98907965.0410260358.259c792b@.posting.google.c om...
> if i query like
> select * from table1 then i will get the following
> ************************************************** **
> Ticker col2 col3 col4 col5
> ----------------
> BRK.A 2003-05-02 70400.00 0.00 78500.00
> FARM 2003-05-02 326.25 3.60 370.99
> GREY 2003-05-02 680.00 4.00 832.00
> ----------------------
> BRK.A 2003-05-09 72700.00 0.00 78500.00
> FARM 2003-05-09 313.00 3.60 370.99
> GREY 2003-05-09 655.00 4.00 832.00
> ----------------------
> BRK.A 2003-05-16 73550.00 0.00 78500.00
> FARM 2003-05-16 311.50 3.60 370.99
> GREY 2003-05-16 649.90 4.00 832.00
> -----------------------
-
> BRK.A 2003-05-23 73850.01 0.00 77000.00
> FARM 2003-05-23 317.25 3.60 370.99
> GREY 2003-05-23 665.00 4.00 832.00
> -----------------------
> BRK.A 2003-05-30 71000.00 0.00 75900.00
> FARM 2003-05-30 322.00 3.60 370.99
> GREY 2003-05-30 657.00 4.00 832.00
> ************************************************** **
> but my output should be as follows
> ***********************************************
> Ticker Item 5/2/2003 5/9/2003 5/16/2003 5/23/2003 5/30/2003
> ----------------------
> BRK.A col3 70400.00 72700.00 73550.00 73850.01 71000.00
> col4 0.00 0.00 0.00 0.00 0.00
> col5 78500.00 78500.00 78500.00 77000.00 75900.00
> ----------------------
> FARM col3 326.25 313.00 311.50 317.25 322.00
> col4 3.60 3.60 3.60 3.60 3.60
> col5 370.99 370.99 370.99 370.99 370.99
> ----------------------
> GREY col3 680.00 655.00 649.90 665.00 657.00
> col4 4.00 4.00 4.00 4.00 4.00
> col5 832.00 832.00 832.00 832.00 832.00
> **********************************************
> can anyone helpme how 2 create the query in order 2 obtain the required
output