Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Thursday, March 22, 2012

adding a break for a /r, is it possible?

I have some data I'm getting back which has address details. The data is separated using a /r. In C# code you can obviously split the /r and replace this with a <br> tag to insert a break. Does anybody know how I can do this within reporting services, is it possible to write some expression to do this? Cheers.


Thanks

Use

=REPLACE(Fields!Address.Value, "/r", vbCrLf")

|||I've tried it and it doesn't work, I've added a quote before the replace vbCrLF but makes no difference|||

Sorry, it should be:

=REPLACE(Fields!Address.Value, "/r", vbCrLf)

No quotes as vbCrLf is a built in variable.

sql

Monday, February 13, 2012

add a column if product is in discrepancies table (was "sql query")

I have a transaction table (which contains details of all products on all orders)
and is have a discrepancies table which includes details on products that couldnt been found (hence error in stock count)...

Now I want to write a query returning details of all products from a specfic orders.. pretty simple

SELECT product, description, qty
from TRANSACTIONS
where order_no = 'xxx'

but i also want to add an extra boolean column (true if product is in discrepancies table and false if product is not in discrepancies table...will become checkbox at front end)... im not sure how to write this bit...

I know it would a transaction table LEFT JOIN to discrepancies table, but I do not know how to write syntax to add extra column...

Be garteful for any help :confused:

Thanksselect product
, description
, qty
, case when exists
( select 937
from discrepancies
where product_id = t.product_id )
then 'oui'
else 'non'
end as discrepancy_exists
from TRANSACTIONS as t
where order_no = 'xxx'|||thanks worked like a treat :)