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

Format Currency and SQL

I've created a view in SQL2005 which has numbers.
I've created a link to the view in Access2000.
I've created a form in Access with the value from the view.
I've changed the format of the value to currency, however it continues to show the value non-formatted.

Why?
Oct 31 '08 #1
9 18359
nico5038
3,080 Expert 2GB
Where did you change the format ?
How are your Regional Settings for currency set ?

The format needs to be set in the (bound) field control on the properties page "Format".
Sometimes the Start/Settings/ControlPanel/Regional Settings give trouble when not having the same numeric separator for decimals for Currency and Numbers. Check that they are equal !

Nic;o)
Oct 31 '08 #2
It set correctly. The odd thing was when I used a table in access, it worked fine, but when I switched to a line to a SQL view, it stopped formating.
Oct 31 '08 #3
I figured it out. You have to go into the Control Source and use =Format([thevariable],"$###,###,###")
Oct 31 '08 #4
nico5038
3,080 Expert 2GB
Strange, the form control's format should "rule".

Can you try to change the view field into a currency field ?

Nic;o)
Oct 31 '08 #5
nico5038
3,080 Expert 2GB
Good find, but still odd that the control's property doesn't work...

Nic;o)
Oct 31 '08 #6
It worked once. I tried another field and I got #error. It must not reconize the variable as number.

Do you know what the view command for currency is?
Oct 31 '08 #7
nico5038
3,080 Expert 2GB
From: http://www.downcastsystems.com/devce...p?ArticleID=51

SELECT '$' + convert(varchar,cast(Price as money),1) as Price FROM YourTable

Nic;o)
Oct 31 '08 #8
Thank you.
It works now. It carried through to the access form.
Option 0 gave me $123456.00
I used the option -1 to give me $123,456.00
Do you know what the option for $123,456 is?
Nov 1 '08 #9
nico5038
3,080 Expert 2GB
When you don't have to update the field you could use for that an access query based on the view with:

select format([yourfield],"$##,###,###") as FormattedPrice ....

Otherwise you should do this formatting in MS SQL.

Nic;o)
Nov 1 '08 #10

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

Similar topics

1
by: Bill Stanard | last post by:
I have had no success using the format function as follows (the two lines of code run one after the other): 'displays a running total of lblAmtdue.Caption 'contents in txtTotal.Text...
2
by: Dalan | last post by:
This should not be an issue, but it is. I'm sure that someone knows what little piece of code is needed too persuade Access 97 to include a currency format for labels (Avery, mailing type). Have...
2
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please...
2
by: Bob Dydd | last post by:
Hi Everbody Question Changing the regional settings ie. from UK to US AUS etc, Access retains the original currency format that the application was created in. So if an mdb that is written...
4
by: Gerry Abbott | last post by:
Hi All. How can i put a zero decimal for my currency into my format statement, == & ", for " & & " days. Cost " & Format(,"Currency") which is the data source for a textbox on a report
1
by: Nigel C | last post by:
Hi, I am going round in circles... I am trying to produce a report based upon the information gathered into a temp table. Each column (stored as a text field) in the table holds weekly...
7
by: zlf | last post by:
1ˇ˘Here is a number. double nu = 123 2ˇ˘Format it with 3ˇ˘The result is "$123" I want to ask how to deformat "$123" to 123 Thx (Currency symbol is not restricted to '$')
3
by: Slonocode | last post by:
I have some textboxes bound to an access db. I wanted to format the textboxes that displayed currency and date info so I did the following: Dim WithEvents oBidAmt As Binding oBidAmt = New...
2
by: crferguson | last post by:
Hello all! I'm having the oddest issue trying to format a numeric string as currency without decimals. For instance... strSalary = "120000.56" strSalary = Format(strSalary, "$#,##0") 'this...
2
by: Ian | last post by:
I have an Access 2000 database written in the UK, this database has many fields set to Currency, I now want to move this database over to a user in the USA but my Currency fields still show the UK...
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
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.