Showing posts with label hellp. Show all posts
Showing posts with label hellp. Show all posts

Sunday, February 19, 2012

hellp with the sql is needed

hello i am a beginner:

on the .mdf sql.s 2005Ex

i need to present:

the 12 month as field name

whan the first filed is the customer name

and the rest is the sum(sale)

so the result will be like this

name 1 2 3 4 5 6 7 8 9 10 11 12

name1 $1 $2 0$ 8$ $1 $2 0$ 8$ $1 $2 0$ 8$

name2 $1 $2 0$ 8$ $1 $23 0$ 8$ $1 $23 0$ 8$

name3 $1 $2 0$ 8$ $1 $2 0$ 8$ $13 $2 0$ 8$

name4 $1 $2 0$ 83$ $1 $2 0$ 8$ $1 $2 0$ 8$

well so far i reached this - wich do the sum but on 12 row per name: well .. so if you could help me ?

SELECT
CASE WHEN MONTHs = 1 THEN MONEY ELSE 0 END AS '1',
CASE WHEN MONTHs = 2 THEN MONEY ELSE 0 END AS '2',
CASE WHEN MONTHs = 3 THEN MONEY ELSE 0 END AS '3',
CASE WHEN MONTHs = 4 THEN MONEY ELSE 0 END AS '4',
CASE WHEN MONTHs = 5 THEN MONEY ELSE 0 END AS '5',
CASE WHEN MONTHs = 6 THEN MONEY ELSE 0 END AS '6',
CASE WHEN MONTHs = 7 THEN MONEY ELSE 0 END AS '7',
CASE WHEN MONTHs = 8 THEN MONEY ELSE 0 END AS '8',
CASE WHEN MONTHs = 9 THEN MONEY ELSE 0 END AS '9',
CASE WHEN MONTHs = 10 THEN MONEY ELSE 0 END AS '10'

FROM

(SELECT DISTINCT MONTH(tblActoin.MyDate) AS MONTHs, SUM(tblActoin.amount) AS MONEY, tblIdentity.name
FROM tblActoin INNER JOIN
tblIdentity ON tblActoin.IdentityID = tblIdentity.id
GROUP BY tblActoin.MyDate, tblIdentity.name) AS derivedtbl_1

thanks

try this

SELECT Names,
sum(CASE WHEN MONTHs = 1 THEN MONEY ELSE 0 END) AS '1',
sum(CASE WHEN MONTHs = 2 THEN MONEY ELSE 0 END) AS '2',
sum(CASE WHEN MONTHs = 3 THEN MONEY ELSE 0 END) AS '3',
sum(CASE WHEN MONTHs = 4 THEN MONEY ELSE 0 END) AS '4',
sum(CASE WHEN MONTHs = 5 THEN MONEY ELSE 0 END) AS '5',
sum(CASE WHEN MONTHs = 6 THEN MONEY ELSE 0 END) AS '6',
sum(CASE WHEN MONTHs = 7 THEN MONEY ELSE 0 END) AS '7',
sum(CASE WHEN MONTHs = 8 THEN MONEY ELSE 0 END) AS '8',
sum(CASE WHEN MONTHs = 9 THEN MONEY ELSE 0 END) AS '9',
sum(CASE WHEN MONTHs = 10 THEN MONEY ELSE 0 END) AS '10,
sum(CASE WHEN MONTHs = 11 THEN MONEY ELSE 0 END) AS '11',
sum(CASE WHEN MONTHs = 12 THEN MONEY ELSE 0 END) AS '12'

FROM

(SELECT DISTINCT MONTH(tblActoin.MyDate) AS MONTHs, SUM(tblActoin.amount) AS MONEY, tblIdentity.name as Names
FROM tblActoin INNER JOIN
tblIdentity ON tblActoin.IdentityID = tblIdentity.id
GROUP BY tblActoin.MyDate, tblIdentity.name) AS derivedtbl_1)

group by Names

|||Yes!!! Thank you!!!

Hellp Please: Running 2 projects under deferent crystal versions

Please need help.

I have spent 2 days and still did not find a solution. I have 2 differnt web applications. One has reports contracted unde Cr 10 and the other Cr 11. For some reasons i can not make it run together. I can install both version and I see all files of both versions in GAC but only one runs at a time if I unintsall lets say Cr 11 and install 10 then only application running under 10 will run, then if I install 11 application under 11 will only run. So it looks like when I install Cr it overrides some file. I cheked machine.cfg nothing in there. I do not have web.cfg in default web site.

This is the error I get:
[COMException (0x80040154): Class not registered - DTSConnection]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +72
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +218

I searched entire web, nothinig helpfull.

If anybody knwos how to solve thise issue, i will be very very thankfullI got some more insight on teh problem that gave me an idea but still no answr. I can set up both web application ussing 2 different crystal versions either on deferent web sistes on the same PC like one on default and the other on some other site and it works and also it works when I set up both of then on other web site than default one. It looks like default site using some regestry or cfg file settings on higher hierarchy level that overrerides web.cfg in virtual dircetory. I cheked machine.cfg what did not seem to have any info for crystal and also I do not have any default web.cfg in default site, at least I do not see it.

Anybody, ideas, please!!!|||See if you find solution here
http://support.businessobjects.com/