Click here to Skip to main content
15,888,351 members
Home / Discussions / Database
   

Database

 
QuestionSmall square in text file Pin
brianjperry27-Mar-07 13:59
brianjperry27-Mar-07 13:59 
AnswerRe: Small square in text file Pin
andyharman28-Mar-07 0:14
professionalandyharman28-Mar-07 0:14 
GeneralRe: Small square in text file Pin
crisp196728-Mar-07 3:56
crisp196728-Mar-07 3:56 
GeneralRe: Small square in text file Pin
andyharman28-Mar-07 4:52
professionalandyharman28-Mar-07 4:52 
QuestionSQL Server collation like Access Pin
eggsovereasy27-Mar-07 9:40
eggsovereasy27-Mar-07 9:40 
AnswerRe: SQL Server collation like Access Pin
DQNOK29-Mar-07 4:06
professionalDQNOK29-Mar-07 4:06 
QuestionPivot Table Generalization Pin
logicon27-Mar-07 8:35
logicon27-Mar-07 8:35 
AnswerRe: Pivot Table Generalization Pin
Pete O'Hanlon28-Mar-07 4:51
mvePete O'Hanlon28-Mar-07 4:51 
Phew - that's one long procedure. If I were you, I would introduce a table that contained the codes that you were interested in, and then in your select statement show the code and the total. The link is a simple inner join, so
((SELECT SUM(SaleLine.Qty)
FROM SaleLine INNER JOIN (Sale INNER JOIN Vendor ON 
Sale.VCode = Vendor.VCode AND
Vendor.BCode = Branch.BCode)
ON SaleLine.SaleCode = Sale.SaleCode AND
Sale.SaleDate = @RepDate AND SaleLine.PCode = 'HT'
)) AS HT,
becomes
LookupTable.Code, ((SELECT SUM(SaleLine.Qty)
FROM SaleLine INNER JOIN (Sale INNER JOIN Vendor ON 
Sale.VCode = Vendor.VCode AND
Vendor.BCode = Branch.BCode)
ON SaleLine.SaleCode = Sale.SaleCode AND
Sale.SaleDate = @RepDate AND SaleLine.PCode = LookupTable.Code
)) AS SumOfValues


Deja View - the feeling that you've seen this post before.

QuestionSQL Express performance on XP Pin
Joe Smith IX27-Mar-07 5:29
Joe Smith IX27-Mar-07 5:29 
AnswerRe: SQL Express performance on XP Pin
kubben27-Mar-07 6:29
kubben27-Mar-07 6:29 
GeneralRe: SQL Express performance on XP Pin
Joe Smith IX27-Mar-07 16:24
Joe Smith IX27-Mar-07 16:24 
GeneralRe: SQL Express performance on XP Pin
kubben28-Mar-07 1:08
kubben28-Mar-07 1:08 
QuestionMirroring connection strings in 1.1 Pin
BoneSoft27-Mar-07 5:10
BoneSoft27-Mar-07 5:10 
Questionnot exist Pin
hadad27-Mar-07 3:18
hadad27-Mar-07 3:18 
AnswerRe: not exist Pin
Marcus J. Smith27-Mar-07 3:26
professionalMarcus J. Smith27-Mar-07 3:26 
AnswerRe: not exist Pin
andyharman27-Mar-07 7:36
professionalandyharman27-Mar-07 7:36 
QuestionHash Table???????? Pin
Ankur.Bakliwal27-Mar-07 2:02
Ankur.Bakliwal27-Mar-07 2:02 
AnswerRe: Hash Table???????? Pin
Christian Graus27-Mar-07 2:13
protectorChristian Graus27-Mar-07 2:13 
AnswerRe: Hash Table???????? Pin
Aaron VanWieren27-Mar-07 2:55
Aaron VanWieren27-Mar-07 2:55 
Questionexporting a crystal report in to Excel format Pin
indian14327-Mar-07 1:21
indian14327-Mar-07 1:21 
QuestionWant to display based on date............... Pin
Member 387988126-Mar-07 23:34
Member 387988126-Mar-07 23:34 
AnswerRe: Want to display based on date............... Pin
Harini N K27-Mar-07 0:01
Harini N K27-Mar-07 0:01 
QuestionNeed Help to Develop Query: [modified] Pin
Shahzad.Aslam26-Mar-07 23:30
Shahzad.Aslam26-Mar-07 23:30 
AnswerRe: Need Help to Develop Query: Pin
hamid_m27-Mar-07 0:34
hamid_m27-Mar-07 0:34 
AnswerRe: Need Help to Develop Query: Pin
Krish - KP27-Mar-07 0:47
Krish - KP27-Mar-07 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.