Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    105

    Unanswered: Need a suggestion on how to revise this query

    Code:
    SELECT     WBS2, (SUM(CASE WHEN wbs2 = '9001' THEN amount * - 1 END)) AS reimb
    FROM         LedgerAR
    WHERE     (WBS1 = '001-298') AND (WBS2 <> 'zzz') AND (WBS3 <> 'zzz') AND transtype = 'in'
    GROUP BY wbs2
    this is what the output looks like:
    Code:
          wbs2     amount 
    	0141	0
    	1217	0
    	1218	0
    	1219	0
    	1222	0
    	1223	0
    	9001	3271.02
    Id there a way to specify where I want this exact amount to display without having to a subquery. I would ideally like to take the 3271.02 and put it where wbs2 = '1217'

    Any suggestions?

    Thank You.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You mean you want to reorder the results to that

    9001, 3271.02

    is in the second row?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •