By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

SQL Format "?"

P: n/a
I have a query:

SELECT [BROKER 3].AH_TICKNO, Format(([BROKER 3].AH_AMOUNT-[BROKER
3].AH_TRNAMT)/[BROKER 3].AH_AMOUNT,"Percent") AS DIF INTO [Broker
Table 5 -Percent]
FROM [BROKER 3];
I dont want to format as a percent, I want it to go into the table
with 4 decimal places, for example .0397
how do I use the format statement and get this result?

Thanks.

Mar 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mar 10, 8:00 pm, shill57...@gmail.com wrote:
I have a query:

SELECT [BROKER 3].AH_TICKNO, Format(([BROKER 3].AH_AMOUNT-[BROKER
3].AH_TRNAMT)/[BROKER 3].AH_AMOUNT,"Percent") AS DIF INTO [Broker
Table 5 -Percent]
FROM [BROKER 3];

I dont want to format as a percent, I want it to go into the table
with 4 decimal places, for example .0397
how do I use the format statement and get this result?

Thanks.

Format returns a string (text) in a desired format. Only number data
types can contain decimals, and of them only the Single and Double
types. The field they are going into must be a Single or Double type
field. I beleive there is also a Decimal Place property of the field
to control how many to display.

If a formatted string is what you're after try
Format(CDbl([value]),"0.0000").

Mar 11 '07 #2

P: n/a
On Mar 11, 1:24 am, "storrboy" <storr...@sympatico.cawrote:
Only number data
types can contain decimals, and of them only the Single and Double
types. The field they are going into must be a Single or Double type
field.
Incorrect. Single and Double are the floating point (approximate)
decimal types, however Access/Jet has two fixed point (exact) decimal
types being CURRENCY and DECIMAL. See:

http://msdn2.microsoft.com/en-us/lib...tsql_datatypes

Jamie.

--

Mar 12 '07 #3

P: n/a


Forgot about those.

Mar 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.