Showing posts with label fill. Show all posts
Showing posts with label fill. Show all posts

Thursday, March 22, 2012

Creating temporary table

Hi,

How can I create a temporary table say "Tblabc" with column fields

ShmCoy char(2)
ShmAcno char(10)
ShmName1 varchar(60)
ShmName2 varchar(60)

and fill the table from the data extracted from the statement...

"select logdetail from shractivitylog"

The above query returns single value field the data seperated with a ''

Ex:
BRLight Blue Duck

in this case I should get
ShmCoy = 'BR'
ShmAcno = ''
ShmName1 = 'Light Blue Duck'
ShmName2 = ''

I want to do this job with single SQL query. Is it possible. Pls help.

Herewith I am providing the sample data

BRLight Blue Duck
0234578
BRAqua Duck
0234586
UBAqua Duck

Regards,
OmavHi.

I think that is better using a stored procedure, but you can try with
this:

create table shractivitylog (logdetail varchar(50))
go

insert into shractivitylog values ('BRLight Blue Duck');
insert into shractivitylog values ('0234578');
insert into shractivitylog values ('BRAqua Duck');
insert into shractivitylog values ('0234586');
insert into shractivitylog values ('UBAqua Duck');

select cast(substring(logdetail,
1,
charindex('',logdetail)-1
) as char(2)) as ShmCoy,
cast(substring(logdetail,
charindex('',logdetail)+1,
charindex('',logdetail,charindex('',logdetail)+1 )-(charindex('',logdetail)+1)
) as char(10)) as ShmAcno,
cast(substring(logdetail,
charindex('',logdetail,charindex('',logdetail)+1 )+1,
charindex('',logdetail,charindex('',logdetail,ch arindex('',logdetail)+1)+1)-(charindex('',logdetail,charindex('',logdetail)+ 1)+1)
) as varchar(60)) as ShmName1,
cast(substring(logdetail,
charindex('',logdetail,charindex('',logdetail,ch arindex('',logdetail)+1)+1)+1,
charindex('',logdetail,charindex('',logdetail,ch arindex('',logdetail,charindex('',logdetail)+1)+ 1)+1)-(charindex('',logdetail,charindex('',logdetail,c harindex('',logdetail)+1)+1)+1)
) as varchar(60)) as ShmName2
into ##tblabc
from shractivitylog

select * from ##tblabc

Bye!

kiran@.boardroomlimited.com (Omavlana) wrote in message news:<b14098ab.0310080226.64bf03c6@.posting.google.com>...
> Hi,
> How can I create a temporary table say "Tblabc" with column fields
> ShmCoy char(2)
> ShmAcno char(10)
> ShmName1 varchar(60)
> ShmName2 varchar(60)
> and fill the table from the data extracted from the statement...
> "select logdetail from shractivitylog"
>
> The above query returns single value field the data seperated with a ''
> Ex:
> BRLight Blue Duck
> in this case I should get
> ShmCoy = 'BR'
> ShmAcno = ''
> ShmName1 = 'Light Blue Duck'
> ShmName2 = ''
> I want to do this job with single SQL query. Is it possible. Pls help.
>
> Herewith I am providing the sample data
> BRLight Blue Duck
> 0234578
> BRAqua Duck
> 0234586
> UBAqua Duck
>
> Regards,
> Omav

Monday, March 19, 2012

creating SSRS in form


hello there,

i am making a form in SSRS and display user details. the form uses only textbox to fill the data.but when i preview the form i just see the data for the first user.i dont see other users.what is the problem.please help

cheers
zolf

Hey! You should switch to a table control. A table control is basically a collection of textboxes in rows and columns.

if you put your fields in the detail section of the table, it will be repeated for every row in the dataset.

HtH

BobP

|||
thanks mate for your comment.
I have used List to create the form and it is displaying data properly.now my problem is, i want to display one user form information on each page.how can i do this in list.please guide me.

cheers

|||

Just set the property on the list box: PageBreakAtEnd to true.

BobP

creating SSRS in form


hello there,

i am making a form in SSRS and display user details. the form uses only textbox to fill the data.but when i preview the form i just see the data for the first user.i dont see other users.what is the problem.please help

cheers
zolf

Hey! You should switch to a table control. A table control is basically a collection of textboxes in rows and columns.

if you put your fields in the detail section of the table, it will be repeated for every row in the dataset.

HtH

BobP

|||
thanks mate for your comment.
I have used List to create the form and it is displaying data properly.now my problem is, i want to display one user form information on each page.how can i do this in list.please guide me.

cheers

|||

Just set the property on the list box: PageBreakAtEnd to true.

BobP