Hi
I'm builing this string dynamically in C# program. I need to add one more
filtering condition of "Sum(Amount) >0" to the Select statement. I added it
but I got an error message. Can someone help on how to do this in one select
statment?
Thanks, Alpha
select exttid,sum(amount) as FeeBalance from tblLedger
where exttid in
(select distinct(exttid) from tblBilling b
where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
and void = 0
group by exttid
Look at the "Having" clause of the select statement. "Having" works on
"Group By" much like the 'Where" works on "From". In your case, you would
add something like:
HAVING Sum(Amount) > 0
after your Group By section.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:F6DA3969-24F9-4895-B7CB-93ECC06EB852@.microsoft.com...
> Hi
> I'm builing this string dynamically in C# program. I need to add one more
> filtering condition of "Sum(Amount) >0" to the Select statement. I added
> it
> but I got an error message. Can someone help on how to do this in one
> select
> statment?
> Thanks, Alpha
> select exttid,sum(amount) as FeeBalance from tblLedger
> where exttid in
> (select distinct(exttid) from tblBilling b
> where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
> and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
> and void = 0
> group by exttid
Showing posts with label hiim. Show all posts
Showing posts with label hiim. Show all posts
Friday, March 30, 2012
Wednesday, March 7, 2012
How can it exactly look like a grid?
Hi
Im new to Crystal report and I want to make a report which look like a grid or spreadsheet. The report should be similar to the tables in MS word. I can show correct data from a view but when I try to add border to it to look like a grid, it look very silly. It is far from a grid look. So can anyone help me, How can I make a grid like report with crystal report V.9?
Thanks in AdvanceI had same problem and still I can not find any solution for it but at that time What I did was just by putting some graphic line in my detail field it was giving me view like perfact table
and at time I did try by using border on every field and no space between consequtive field and both was working for me but I choose 1st option for my solution just try to be more "desingner" instead of developer ,, Ha ha .. that's what I did...
Hey if you find any good solution for this let me know
Thanks and best of luck ..|||Yes better be a designer.
u can put ur fields in a box and give border to ur fields
it looks like HTML table with padding
can look funny too :-))|||well you can select the report style as table
and later do some formatting..
Im new to Crystal report and I want to make a report which look like a grid or spreadsheet. The report should be similar to the tables in MS word. I can show correct data from a view but when I try to add border to it to look like a grid, it look very silly. It is far from a grid look. So can anyone help me, How can I make a grid like report with crystal report V.9?
Thanks in AdvanceI had same problem and still I can not find any solution for it but at that time What I did was just by putting some graphic line in my detail field it was giving me view like perfact table
and at time I did try by using border on every field and no space between consequtive field and both was working for me but I choose 1st option for my solution just try to be more "desingner" instead of developer ,, Ha ha .. that's what I did...
Hey if you find any good solution for this let me know
Thanks and best of luck ..|||Yes better be a designer.
u can put ur fields in a box and give border to ur fields
it looks like HTML table with padding
can look funny too :-))|||well you can select the report style as table
and later do some formatting..
Subscribe to:
Posts (Atom)