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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MNelson831Connect With a Mentor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.