Showing posts with label anyways. Show all posts
Showing posts with label anyways. Show all posts

Wednesday, March 28, 2012

Need to build a query

Hey. It's probably a very simple query but I'm not at all good in writing
T-SQL. Anyways, My environment is SQL 2005.
I need to write a stored proc which returns 4 columns to a C# app. All the
data comes from one table only.
The first column will just have 'Name of months'
The second column will have a sum of amount
(-sum of amount in jan in first row,
-sum of amount in feb in row 2,
-sum of amount in feb in row 3,
-sum of amount in feb in row 4)
The third row will have a sum of won per month for this year(just like 2nd
column),
The fourth row will have a sum of Lost per month for this year(just like 2nd
column
I'm very new to SQL 2005.
Thank you.Before we can help you, please help us:
http://www.aspfaq.com/etiquette.asp?id=5006
ML
http://milambda.blogspot.com/|||It sounds like you are trying to get 4 different datasets returned as 4
distinct rows in a single query, simply so you can display them as one
dataset. While this is possible, it is not advisable.
Your best bet is to select whatever the core data is that you will be basing
your calculations on and then process it in your application.
"Tejas Parikh" <TejasParikh@.discussions.microsoft.com> wrote in message
news:5BE2F352-33C6-4A02-88B1-9EC75F843B96@.microsoft.com...
> Hey. It's probably a very simple query but I'm not at all good in writing
> T-SQL. Anyways, My environment is SQL 2005.
> I need to write a stored proc which returns 4 columns to a C# app. All the
> data comes from one table only.
> The first column will just have 'Name of months'
> The second column will have a sum of amount
> (-sum of amount in jan in first row,
> -sum of amount in feb in row 2,
> -sum of amount in feb in row 3,
> -sum of amount in feb in row 4)
> The third row will have a sum of won per month for this year(just like 2nd
> column),
> The fourth row will have a sum of Lost per month for this year(just like
2nd
> column
> I'm very new to SQL 2005.
> Thank you.|||Never mind my last post. In your other post you explained clearly what you
were trying to do. I misunderstood your goals entirely.
"Tejas Parikh" <TejasParikh@.discussions.microsoft.com> wrote in message
news:5BE2F352-33C6-4A02-88B1-9EC75F843B96@.microsoft.com...
> Hey. It's probably a very simple query but I'm not at all good in writing
> T-SQL. Anyways, My environment is SQL 2005.
> I need to write a stored proc which returns 4 columns to a C# app. All the
> data comes from one table only.
> The first column will just have 'Name of months'
> The second column will have a sum of amount
> (-sum of amount in jan in first row,
> -sum of amount in feb in row 2,
> -sum of amount in feb in row 3,
> -sum of amount in feb in row 4)
> The third row will have a sum of won per month for this year(just like 2nd
> column),
> The fourth row will have a sum of Lost per month for this year(just like
2nd
> column
> I'm very new to SQL 2005.
> Thank you.sql

Friday, March 9, 2012

Need more Excel Power >> Excel Writer\Crystal ??

Hey all-
This may not be the right place for this, but I am going to ask anyways. I
am very happy with RS for the most part. However, Excel is limited and thats
what I need to have control over. I have been given a directive to make the
excel reports print without having to reformat them (cell size, landscape,
etc.). This means I need at the PageSetup method in excel. I've seen a few
trys at making this better, but nothing rock solid from within RS so I need
to look elsewhere.
I have been looking at Crystal Reports, but not sure what version to go with
(Reporting services, enterprize, etc.) and also ExcelWriter from
SoftArtisans. Looking for feedback and\or recommendations.
Thanks,
DougIf they need to print then why don't they export to pdf?
"billy bob" wrote:
> Hey all-
> This may not be the right place for this, but I am going to ask anyways. I
> am very happy with RS for the most part. However, Excel is limited and thats
> what I need to have control over. I have been given a directive to make the
> excel reports print without having to reformat them (cell size, landscape,
> etc.). This means I need at the PageSetup method in excel. I've seen a few
> trys at making this better, but nothing rock solid from within RS so I need
> to look elsewhere.
> I have been looking at Crystal Reports, but not sure what version to go with
> (Reporting services, enterprize, etc.) and also ExcelWriter from
> SoftArtisans. Looking for feedback and\or recommendations.
> Thanks,
> Doug
>