Groups | Blog | Home
all groups > sql server reporting services > february 2006 >

sql server reporting services : Query Help


Shan
2/6/2006 2:08:32 PM
I have query with following column names:
cust_no, Firm_no, Name, homeaddress, homecity, homestate, homezip,
officeaddress, officecity, officestate, officezip

I want to be able to pull it this way that whenever there is a certain
unique Firm_no it should populate the homeaddress, homecity, homestate,
homezip for this customer.

What do I have to do to accomplish this?

saras
2/7/2006 12:54:58 AM
U can achieve this by the following way:

Use the following expresson to display Homeaddress:

=IIF(IsNothing(Previous(Fields!Firm_no.Value)),
Fields!homeaddress.Value,
IIF(Fields!Firm_no.Value = Previous(Fields!Firm_no.Value),
"",
Fields!homeaddress.Value))


In the same way implement the same logic to display homecity, homestate,
homezip.

Regards,
Shan
2/7/2006 7:21:42 AM
saras,

I have a unique firm_no that I want to use when my report runs it should
look like:

Custo_no Firm_no Name Address City State Zip
123 1111 Jon Doe Main Dallas TX 75000
321 1122 Jon Doe Globe Pano TX 75001

So when anytime the Firm_no is '1122' I want the address to print their
homeaddress.

Thanks for your help.
[quoted text, click to view]
Shan
2/7/2006 7:29:32 AM
Thanks Saras, It worked I just dint have it in the correct place. Stupid
typo mistake. Thanks a bunch have a great day!

[quoted text, click to view]
Shan
2/7/2006 7:36:28 AM
Saras,

Sorry to bother again...but now its printing all the homeaddress I still
have this questions:

I have query with following column names:
cust_no, Firm_no, Name, homeaddress, homecity, homestate, homezip,
officeaddress, officecity, officestate, officezip

I want to be able to pull it this way that whenever there is a certain
unique Firm_no it should populate the homeaddress, homecity, homestate,
homezip for this customer.

What do I have to do to accomplish this?

Thanks


[quoted text, click to view]
saras
2/7/2006 11:48:22 PM
Can u provide some more data, how u actually want to display?

Regards,
Shan
2/8/2006 7:48:27 AM
Ok. I have these fields.
Cust_no, Firm_name, Firm_no, Name, OfficeAddr, OffCity, OffSt, OffZip,
HomeAddr, Homecity, HomeSt, HomeZip

In my report I only want to show based on my query the following format

Custo_no Firm_name Firm_no Name Address City State Zip
123 Keller 1111 Jon Doe Main Dallas TX 75000
321 Ebby 1122 Jon Doe Globe Pano TX 75009
102 Cold 1234 Jon Doe Holly Plano TX 75002
103 Nonmember 1000 Jon Doe Trench Allen TX 75001
109 Nonmember 1000 Jon Doe Trail Prosper TX 75003

Now I want to populate the Address field with customer's homeAddr anytime
the firm_no is 1000 which is a Non member otherwise if the firm_no is
anything else then populate the Address with their OfficeAddr. The Firm_no
1000 doesn't have an OfficeAddr so we want to populate it with customer's
homeaddr.

Thanks for your help.

[quoted text, click to view]
AddThis Social Bookmark Button