Showing posts with label newbie. Show all posts
Showing posts with label newbie. Show all posts

Friday, March 23, 2012

Joins in Crystal Reports

Hi,
I'm newbie in Crystal report. I've a query which i'm unable to implement in CR. Eventhough the query looks simple because of the join condition I'm struggling . Pls help me to implement the join condition. I run the query in DB2

select sum(bank_ledger_bal_amt),calendar_date
from table_a a
inner join table_date b
on a.bank_acct_eff_dt <= b.calendar_date
and a.bank_acct_disc_dt > b.calendar_date
where month_id = 'feb'
group by b.calendar_date
order by b.calendar_date
;

Thanks,
JashUse the add command of Crystal and paste in your SQL query in there.
GJ|||Sorry I didnt get what do you mean|||In the Database Expert there is an option to select "Add Command" there you can type out your sql. Crystal will let you know if there is an error in your SQL.
GJsql

Friday, March 9, 2012

Joing Multiple Columns

Hi All,

Bit of a newbie question i'm afraid, so sorry if this is a really
stupid question,

I am not sure if I am trying to do this in the right place as I am sure
SQL Server has a far better way of doing this

What I am trying to do is join the contents of several columns and
present the entry into a new column. the entries of all the columns I
am trying to join are different types such as dates and numbers. I want
to join all columns as a text string. To make it just a even more
tricky I wish to insert a # between all fields.

Just in case my poor description has got you thinking What the F*&K
here is an example of what I am trying to do

C1 C2 C3 C4 C5
Ian 1234 22/02/2006 123456789 Ian#1234#22/02/2006#1234567890
I have been trying to do this in the Formula in the design veiw of the
table.

Any Advice would be fantastic.

Many Thank

IanTry:

select
C1 + '#' + cast (C2 as varchar (10)) + '#' + convert (char (10), C3,
103) + '#' + cast (C4 as varchar (10))
from
MyTable

--
Tom

----------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Crumb" <rowan.ian@.gmail.com> wrote in message
news:1140655591.245227.133490@.f14g2000cwb.googlegr oups.com...
Hi All,

Bit of a newbie question i'm afraid, so sorry if this is a really
stupid question,

I am not sure if I am trying to do this in the right place as I am sure
SQL Server has a far better way of doing this

What I am trying to do is join the contents of several columns and
present the entry into a new column. the entries of all the columns I
am trying to join are different types such as dates and numbers. I want
to join all columns as a text string. To make it just a even more
tricky I wish to insert a # between all fields.

Just in case my poor description has got you thinking What the F*&K
here is an example of what I am trying to do

C1 C2 C3 C4 C5
Ian 1234 22/02/2006 123456789 Ian#1234#22/02/2006#1234567890
I have been trying to do this in the Formula in the design veiw of the
table.

Any Advice would be fantastic.

Many Thank

Ian