hi
I am having trouble with the following query within my store procedure.
as you can see, i am making an union of 2 separate queries.
in the 2nd part of the union, i encounter a column in the database where the column name is the same as the keyword "desc"
is there a way which i can get around this, or is there any other way that i can sepecify the column? (excluding the possibility of using *)
CREATE PROCEDURE topcat.getTransHistory
(
@.contact_id numeric(9)
)
AS
BEGIN
DECLARE @.phone_no varchar(255)
set @.phone_no = (select top 1 phone_num from topcat.class_contact where _id = @.contact_id)
select cast(trans_new.trans_date as varchar(50)) date,
'' code,
cast(payment.date_paid as varchar(50)) datepaid,
'' "desc",
case payment.payment_type
when 'cheque' then trans_new.item_total
else ''
end pledged,
'' mail,
case payment.payment_type
when 'cheque' then ''
else trans_new.item_total
end received,
'' receipt
from topcat.class_transaction trans_new left outer join topcat.class_payment payment on trans_new._id = payment.transaction_id
where trans_new.contact_id = @.contact_id
union
select cast(trans_old.date as varchar(50)) "date",
trans_old.code,
cast(trans_old.datepaid as varchar(50)) "datepaid",
trans_old.desc,
cast(trans_old.pledged as varchar(128)),
trans_old.mail,
cast(trans_old.received as varchar(128)),
trans_old.receipt
from topcat.MMTRANS$ trans_old
where phone = @.phone_no
END
GO
Cheers
James :)wrap your column name that is a keyword in square brackets eg [desc]|||thank you
thank you
thank you
you are a life saver, i was goin to change the column name of the table if i couldn't find an alternative way of doing it.
:)|||no worries,... try to avoid keywords in the future would be my advise though... ;)|||i was on a contract once and there converted database had tables and columns all over the place named with keywords.
i will never forget they had a column called select in a table called order.
nightmare to say the least.
Showing posts with label separate. Show all posts
Showing posts with label separate. Show all posts
Wednesday, March 7, 2012
Monday, February 20, 2012
Problem with Page break and Visibility expression
Hi,
I am using sql server 2005 sp1 reporting services.
Currently creating a report, which contains several sub-reports held in
separate rectangles. The rectangles need page breaks to be displayed after
the rectangle. I have checked the â'Insert After Rectangleâ' page break
attribute on the General tab.
The problem is I want the page breaks on the rectangle to work when I set
the visibility attribute to false (this allows the rectangle to display). I
am setting the visibility using an expression and the text in the rectangle
displays properly, but the page breaks do not work.
Can anybody shed any light on this?
Thanks.Hello ringt,
This is a known issue in Reporting Services 2005. I am contacting to the
Product Team to check whether there is any workaround. I appreciate your
patience. Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hello ringt,
Unfortunately, I have not got any update from the product team. I
appreciate your patience.
Sincerely,
Wei Lu
Microsoft Online Community Support|||Hello ringt,
Unfortunately, the product team feedback that there is no workaround now
for this issue. They are addressing in a future release.
If this really impact your business, you could open a CSS case so taht a
Support Professional can work with you in a more timely and efficient
manner.
If there are further questions on the issue, please feel free to let us
know. Have a great day!
Sincerely,
Wei Lu
Microsoft Online Community Support|||You can insert a rectangle into a rectangle, and set a page break in the
inner rectangle and visibility in the outer and paste this nested rectangles
in between subreports. It Visible expression is True, the page break will
work. if Visible expression is False , it will ignore a Page Break. I have
Master report with a few subreports which need to be separated by page
breaks and shown/hidden depending on the input parameters and this approach
worked for me.
I am using sql server 2005 sp1 reporting services.
Currently creating a report, which contains several sub-reports held in
separate rectangles. The rectangles need page breaks to be displayed after
the rectangle. I have checked the â'Insert After Rectangleâ' page break
attribute on the General tab.
The problem is I want the page breaks on the rectangle to work when I set
the visibility attribute to false (this allows the rectangle to display). I
am setting the visibility using an expression and the text in the rectangle
displays properly, but the page breaks do not work.
Can anybody shed any light on this?
Thanks.Hello ringt,
This is a known issue in Reporting Services 2005. I am contacting to the
Product Team to check whether there is any workaround. I appreciate your
patience. Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hello ringt,
Unfortunately, I have not got any update from the product team. I
appreciate your patience.
Sincerely,
Wei Lu
Microsoft Online Community Support|||Hello ringt,
Unfortunately, the product team feedback that there is no workaround now
for this issue. They are addressing in a future release.
If this really impact your business, you could open a CSS case so taht a
Support Professional can work with you in a more timely and efficient
manner.
If there are further questions on the issue, please feel free to let us
know. Have a great day!
Sincerely,
Wei Lu
Microsoft Online Community Support|||You can insert a rectangle into a rectangle, and set a page break in the
inner rectangle and visibility in the outer and paste this nested rectangles
in between subreports. It Visible expression is True, the page break will
work. if Visible expression is False , it will ignore a Page Break. I have
Master report with a few subreports which need to be separated by page
breaks and shown/hidden depending on the input parameters and this approach
worked for me.
Labels:
break,
contains,
creating,
database,
expression,
microsoft,
mysql,
oracle,
page,
rectangles,
report,
reporting,
separate,
server,
services,
sp1,
sql,
sub-reports,
visibility
Subscribe to:
Posts (Atom)