|
hi Blue_Boy
when i fill may data set it gives error (Data type mismatch in criteria expression)
|
|
|
|
|
Parameter values which you add include inside single quotes.
" SELECT * From ClassRoom <br />
Where Capacity >= '" & SumCapacity & "' <br />
and RoomID not in(SELECT RoomID from [Slot] where SlotID= '" & Slots4Sec.Tables("Slot").Rows(0).Item(0) & "' or SlotID= '" & Slots4Sec.Tables("Slot").Rows(1).Item(0) & "' or SlotID ='" & Slots4Sec.Tables("Slot").Rows(2).Item(0) & "' or SlotID ='" & Slots4Sec.Tables("Slot").Rows(3).Item(0) & "') " <br />
& " ORDER BY Capacity asc"
I Love T-SQL
Don't torture yourself,let the life to do it for you.
|
|
|
|
|
thanks
i found the error it was that the type of roomid is different in the to table
thanks so much
|
|
|
|
|
You are welcome...
I Love T-SQL
Don't torture yourself,let the life to do it for you.
|
|
|
|
|
hi friends,
i have a report using matrix table something like..
Jan | Feb | Mar
-----------------------------------------------
sale | s_qty | sale | s_qty | sale | s_qty
-----------------------------------------------
Loc_A 10 | 20 | 10 | 15 | 20 | 50
11 | 16 | 30 | 15 | 20 | 20
10 | 20 | 05 | 10 | 50 | 10 **
Loc_B 15 | 30 | 40 | 45 | 10 | 60
14 | 16 | 30 | 15 | 20 | 20
19 | 20 | 05 | 10 | 50 | 10 **
Loc_C 10 | 20 | 10 | 15 | 20 | 50
11 | 16 | 30 | 15 | 20 | 20
10 | 20 | 05 | 10 | 50 | 10
Now whats my problem is i need the summary of each group.(showed in '**').
i used Matrix table , and now showing the grand Total also. but i need group summary.
Can any one help me..
Thanks in advance...
|
|
|
|
|
You need to group by Loc_A,Loc_B and Loc_C ?
Write result which you want to get.
I Love T-SQL
Don't torture yourself,let the life to do it for you.
|
|
|
|
|
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 )
|
|
|
|