473,382 Members | 1,420 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,382 software developers and data experts.

Microsoft format function in query and dealing with nulls

3
I have a number in a table that starts off as currency. There are nulls in the data so I'm trying to convert the nulls to zeros and then wind up back in currency, or in fact in any numeric format. I've tried both of these.


Add: Format(nz([Adds],0),"Standard")
Add: Format(nz([Adds],0),"$#,##0.00")


With this I wind up with what looks like numbers but when I export to Excel or try to subtotal at the bottom of the query I don't have numbers that will add up?

I'm kind of new to this if you can't tell. HELP and THANKS!
Oct 3 '07 #1
5 2347
puppydogbuddy
1,923 Expert 1GB
I have a number in a table that starts off as currency. There are nulls in the data so I'm trying to convert the nulls to zeros and then wind up back in currency, or in fact in any numeric format. I've tried both of these.


Add: Format(nz([Adds],0),"Standard")
Add: Format(nz([Adds],0),"$#,##0.00")


With this I wind up with what looks like numbers but when I export to Excel or try to subtotal at the bottom of the query I don't have numbers that will add up?

I'm kind of new to this if you can't tell. HELP and THANKS!
If you have a text data type, try converting to numeric via VAL function and see if that helps. Not sure what order the functions have to take place.

Format(nz(Val([Adds]),0),"Currency")
or
nz(Format(Val([Adds]),"Currency"),0)
Oct 3 '07 #2
BXB
3
Tried it and it still didn't work, same issue, neither Access or Excel is recognizing this data as a number and I can't get it to sum!

Any other ideas?
Oct 4 '07 #3
puppydogbuddy
1,923 Expert 1GB
Tried it and it still didn't work, same issue, neither Access or Excel is recognizing this data as a number and I can't get it to sum!

Any other ideas?
i think I may have had functions working in the wrong order, try it this way. It makes more sense given that the Val function works on just numerical characters.:

Format(Val(nz([Adds], 0)),"Currency")

or in case Val is not working, try this (CDbl converts to a double precision number:)

Format(CDbl(nz([Adds], 0)),"Currency")
Oct 4 '07 #4
BXB
3
It didn't work, but you made me realize importance of what comes first so I tried

Val(nz(format([Adds],0),"Currency"))

And it worked....this forum is great!
Oct 4 '07 #5
puppydogbuddy
1,923 Expert 1GB
It didn't work, but you made me realize importance of what comes first so I tried

Val(nz(format([Adds],0),"Currency"))

And it worked....this forum is great!
Glad we could help you get it resolved. Thanks for posting back with the final solution. It should help a lot of Access users and developers. Now that I think about this, it makes sense that val would be the last function applied since it returns only numeric values.
Oct 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a...
2
by: jquest | last post by:
Hi Again; I am improving my database and have to overcome some original design mistakes. I have 3500 records in the table and I have had to insert new fields to track things I originally didn't...
12
by: strict9 | last post by:
Hello all, I'm writing several queries which need to do various string formating, including changing a phone number from (123) 456-7890. After some problem with data mismatches, I finally got it...
1
by: mrkselm | last post by:
Hi, I am stuck with a problem in MS Access which does not occur in SQL Server and I have been banging my head against the wall for a couple of days now trying to resolve it. Namely, when I...
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
6
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in...
6
by: Darren | last post by:
I'm trying to build a query but struggling on how to achieve the linking. For examples, I have a table and a view similar to this.. Table: Accounts ACC_REF Char(3), DESCRIPTION VARCHAR(30),...
1
by: kewldudehere | last post by:
Hi All, I am trying to execute this kind of query that uses'Not in ' function but unable to get 'Nulls' select * from table1 where col1 not in (select col2 from table2). Here col1 is not...
12
by: Icarus | last post by:
My database, built in Access 2000 but opened in Access 2007 does not seem to like the function CStr$ (with the dollar sign after), and gives me an error message. However, if I change the function...
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...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.