Set data type of field

BobJones

Registered User.
Local time
Today, 16:33
Joined
Jun 13, 2006
Messages
42
I have a query to go through a table and pick up the amount of money earnt during a period then I use that field to calculate commission, but the commission field just shows up as numbers and not as currency as the set field in the table does.
Is there anyway in SQL to say what sort of data type a field should be...
Example of sql string

SELECT Sum([Work].[Earnings]) AS [Period Earnings], [Period Earnings]*(17.5/100) AS [Commisssion] FROM Policy
 
Hi -

With the query in design view:
1) Highlight the field in question.
2) Right-click to bring up the shortcut menu and select then Properties.
3) Under Field Properties select Format and then Currency.

If you're going the SQL route, try:

SELECT Sum([Work].[Earnings]) AS [Period Earnings], format([Period Earnings]*(17.5/100), "Currency") AS [Commisssion] FROM Policy

HTH - Bob
 
Last edited:
Thanks man.

You are a star! :)
 

Users who are viewing this thread

Back
Top Bottom