|
i used stored procdure for tat & i grouped in the report. the current result i'm getting is what i showed. but i need the group wise total...
|
|
|
|
|
Ok, now you need to get sum of columns sale,s_qty grouped by Loc_A,Loc_b and Loc_c?
Are you usng Crystal Report to show data report?
I Love T-SQL
Don't torture yourself,let the life to do it for you.
|
|
|
|
|
No, i'm using SQL Reporting, & i used Matrix Table
|
|
|
|
|
Hello everybody,
I try to show you the output but when I look from the preview part, the design is get out of order. I want to ask you how can I make the "null" parts gone? There are now empty spaces instead of nulls. But I want namesurname one after another without no spaces.
The output of this code is ;
MacType DAYS MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY
B(+) NIGHT BIRCAN AR
B(+) NIGHT BIRCAN AR
B(+) NIGHT HASAN DEM HASAN DEM
B(+) NIGHT HAVVA SUK HAVVA SUK
B(+) NIGHT HAVVA SUK
B(+) NIGHT MEHDIYE GÖR
B(+) NIGHT KEREM GOK
Here is my second table's view as I want.
What should I do to get this output?
MacType DAYS MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY
B(+) NIGHT BIRCAN AR BIRCAN AR HAVVA SUK HAVVA SUK
B(+) NIGHT HASAN DEM HASAN DEM MEHDIYE GÖR
B(+) NIGHT HAVVA SUK KEREM GOK
This my code;
select ISNULL(MAX(MachineType),''),
ISNULL(MAX(DAYS),''),
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'MONDAY'THEN NAMESURNAME END),'') AS MONDAY,
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'TUESDAY' THEN NAMESURNAME END),'') AS TUESDAY,
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'WEDNESDAY' THEN NAMESURNAME END),'') AS WEDNESDAY,
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'THURSDAY' THEN NAMESURNAME END),'') AS THURSDAY,
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'FRIDAY' THEN NAMESURNAME END),'') AS FRIDAY,
ISNULL(MAX(CASE WHEN DIALYSISDAY= 'SATURDAY' THEN NAMESURNAME END),'') AS SATURDAY
from
(SELECT SICK.MACHINETYPE,SICK.NAMESURNAME ,
CASE WHEN SUBSTRING(DAYPERIOD, DATEPART(dw, SEANCE.SEANCEDATE), 1)= 'N' THEN 'NIGHT' ELSE '' END AS DAYS,
CASE WHEN SICK.MACHINETYPE= 1 THEN 'Negative-'
WHEN SICK.MACHINETYPE= 2 THEN 'B(+)'
WHEN SICK.MACHINETYPE= 3 THEN 'C(+)B(+)'
WHEN SICK.MACHINETYPE= 4 THEN 'C(+)' END AS MachineType,
CASE WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 1 THEN 'MONDAY'
WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 2 THEN 'TUESDAY'
WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 3 THEN 'WEDNESDAY'
WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 4 THEN 'THURSDAY'
WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 5 THEN 'FRIDAY'
WHEN (DATEPART(dw, SEANCE.SEANCEDATE)) = 6 THEN 'SATURDAY' END AS DIALYSISDAY
FROM SEANCE,SICK
WHERE SUBSTRING(DAYPERIOD, DATEPART(dw, SEANCE.SEANCEDATE), 1)= 'N'
and SUBSTRING(SICK.EUCLID,1,5)= '18016'
AND SEANCEDATE BETWEEN '20080301' AND '20080307'
AND SICK.EUCLID=SEANCE.EUCLID )AS T
GROUP BY MachineType,
DAYS,
CASE WHEN DIALYSISDAY= 'MONDAY'THEN NAMESURNAME END,
CASE WHEN DIALYSISDAY= 'TUESDAY' THEN NAMESURNAME END,
CASE WHEN DIALYSISDAY= 'WEDNESDAY' THEN NAMESURNAME END,
CASE WHEN DIALYSISDAY= 'THURSDAY' THEN NAMESURNAME END,
CASE WHEN DIALYSISDAY= 'FRIDAY' THEN NAMESURNAME END,
CASE WHEN DIALYSISDAY= 'SATURDAY' THEN NAMESURNAME END
ORDER BY MachineType
|
|
|
|
|
Ever heard of CAST and TRIM?
If not then google it, and use it!
HTH.
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi,
By default when i install SQL Express Edition i don't havethe connexion named NT AUTHORITY\NetworkService. My problem is than i use integrated security in my connection string to allow instance user.
Integrated security need NT AUTHORITY\NetworkService to allow connexion to database.
How to create this account?
Who have a idea?
Thanks
|
|
|
|
|
Which OS you are using?
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Windows Server 2003 Standard edition.
|
|
|
|
|
Can you please put more light on exactly what you are doing and how/where are you finding that account?
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
hi
i want to look for feature start with leter 'b'
can i write
select * from mytable where feature like 'b%'
i want to make sure before starting so please help me
|
|
|
|
|
1. Please check your English. Your message title makes no sense.
2. Part of programming is making mistakes and learning from them. We are not here to hold your hand so you can always get it right the first time.
|
|
|
|
|
you can write that.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
Donate to help Conquer Cancer[ ^]
|
|
|
|
|
|
If you want to get all values which starts with letter b then use that query.
I Love T-SQL
Don't torture yourself,let the life do it for you.
|
|
|
|
|
|
Why would you ask this and not just try it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
because my program not ready
|
|
|
|
|
Are you coding Management Studio?
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
OK - so why worry about SQL if you're incapable of running any ? I guess you need to wait until you can test your code. Or use a database with client tools.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
May be because its complex and time taking
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
i want to download adventureworks database but i have slow internet connection. I tried to download from codeplex site but when i click on the link a dialogbox appears asking "i agree" and "i disagree". i want to use flashget for downloading it but that requires direct link and in presence of that link i can't download that. Can somebody tell me that is there any other site from where i can download this with direct link using any download manager.
|
|
|
|
|
You should make a google search...[^] , and you will find any direct link to download it.
I Love T-SQL
Don't torture yourself,let the life do it for you.
|
|
|
|
|
Hello,
I try to implement a WSE 3.0(webservice) in database in SQL server 2005 Standard. The scenario is :
- 1) Winform that call a webservice(send a token to webservice).
- 2) The Webservice call a Custom UsernameTokenManager (using the protected override string AuthenticateToken( UsernameToken token ))
- 3)Sql Server version is Standard version on my Server, but this database is configured by aspnet_regsql.exe to allow Membership functionnalities.
All works correctly to create user thru the webservice, but when i try to validate the user with (Membership.ValidateUser(login,password)i have this error:
The indicator opening session of instant user is not supported in this version of SQL Server.
Can you help me??
Thanks
|
|
|
|
|
hi
I tried to add my db to the server mssql136.win-servers.com ,
and I didn't know how do it ?
jooooo
|
|
|
|
|
Your host should be the best bet contact for this query. Wouldn't it be the case?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|