473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Expression column with ABS

I want to add a Expression column for all the negative amount and want to
show them as positive. What am I doing wrong in my code. It shows nothing
when amount is negative.

dsAccounts.AccountBalanceDetails.Columns.Add("Cred it Amount",
GetType(Decimal), "Iif(Amount <0 ,abs(Amount),0)")

Please help, Thanks
Kartic
Nov 20 '05 #1
2 4580
I'm not sure that abs() is supported as an expression. As a workaround you
can multiply by -1:

dsAccounts.AccountBalanceDetails.Columns.Add("Cred it Amount",
GetType(Decimal), "Iif(Amount <0 ,Amount*(-1),0)")

Nov 20 '05 #2
"Kartic" <kg****@csystemssoftware.com> schrieb
I want to add a Expression column for all the negative amount and
want to show them as positive. What am I doing wrong in my code. It
shows nothing when amount is negative.

dsAccounts.AccountBalanceDetails.Columns.Add("Cred it Amount",
GetType(Decimal), "Iif(Amount <0 ,abs(Amount),0)")


Abs is not a valid function. Have a look at the documentation of
DataColumn.Expression. There the available functions, expressions and
operators are explained.
--
Armin

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
2
by: Al Christians | last post by:
I've got an idea for an application, and I wonder how much of what it takes to create it is available in open source python components. My plan is this -- I want to do a simple spreadsheet-like...
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
4
by: perspolis | last post by:
I have 3 columns in my datatabel name Total,unit,Price. I use a column expression in my project..and in this expression i multiplied two column... for example ...
5
by: perspolis | last post by:
hi everyone I used a column expression like "UnitPrice*Quantity" for a cloumn named Total. but when I want to update my dataset by SqlDataAdopter, it gives me error. The column Total is just for...
1
by: Andrew | last post by:
How can I create a property or function for a typed datasets column? By this I need to add a new column (element) to the table or override an existing column. For instance I have an Invoice table...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
2
by: Kjetil Klaussen | last post by:
Hi, I’m having some troubles trying to bind my dataset to a GridView control through an ObjectDataSource control. The binding works fine for regular columns in my dataset, but I can’t seem...
3
by: shark | last post by:
Hi Is it any way to use current column value in Expression for this column. Let say we want to have: DataColumn2.Expression = IIF(DataColumn1 <0, DataColumn1, DataColumn2) Its'n valid but how...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.