How do I split a column?

Now I have one column that has positive and negative values, Now I want to split this column the positive and negative shoaled be separated

how do I do it?

Thanks for any help
LVL 1
AYidAsked:
Who is Participating?
 
MNelson831Commented:
SELECT Format(IIf([MyDataField]>0,[MyDataField],0),"Currency") AS MyPosNums, Format(IIf([MyDataField]<0,[MyDataField],0),"Currency") AS MyNegNums
FROM MyTableName;

0
 
MNelson831Commented:
Select
     Case
          When MyFieldValue < 0 then MyFieldValue
          Else 0
     End as MyNegNumbers,
     Case
          When MyFieldValue > 0 then MyFieldValue
          Else 0
     End as MyPosNumbers
From
     MyTableName
Where
     MyCriteria = True



     
0
 
AYidAuthor Commented:
I'm getting an error

syntax error
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AYidAuthor Commented:

syntax error (missing operator) in query expression

Open in new window

0
 
MNelson831Commented:
Are you running this in Access or SQL?
0
 
AYidAuthor Commented:
Accses
0
 
MNelson831Commented:
SELECT IIf([MyDataField]>0,[MyDataField],0) AS MyPosNums, IIf([MyDataField]<0,[MyDataField],0) AS MyNegNums
FROM MyTableName;
0
 
MNelson831Commented:
Look in this file for example
db9.mdb
0
 
AYidAuthor Commented:
Thanks it works great!!!

one more thing.. what is the syntax to format it as currency?
0
 
AYidAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.