|
-
Jul 2nd, 2002, 01:11 AM
#1
Thread Starter
Hyperactive Member
Formated output from Acces2000 - SQL
Greetings,
i have a few querries like the one below.
SELECT [Statistics].[Year], [Statistics].[RoomType],
SUM([Preis]*[Tage])/SUM([Tage]) AS [Avg Of Preis]
FROM Statistics
WHERE [Statistics].[RoomType]='4'
GROUP BY [Statistics].[Year], [Statistics].[RoomType]
ORDER BY [Statistics].[RoomType];
how can I get an output for the field
SUM([Preis]*[Tage])/SUM([Tage]) AS [Avg Of Preis]
as an international format 00.00 (only 2 numbers after the decimalpoint?) in the moment I get n numbers after the DP
many thanks
Manfred
-
Jul 2nd, 2002, 01:15 AM
#2
Fanatic Member
Hi
I am not sure that it works:
Format(SUM([Preis]*[Tage])/SUM([Tage]),"00.00") will work in Excel. Maybe you should have a look into the format method. I never tried it with a SQL-command. If you got the solution please put it here as a post.
Franky
-
Jul 2nd, 2002, 01:30 AM
#3
Thread Starter
Hyperactive Member
Franky, nice try but did not work
I can manipulate the output if I use the Query Builder (Property)
but it does not show up in the sql statement.
This methode I can use only for querries in the DB but I also have querries direct from a VB app.
So this thread is still open.
-
Jul 2nd, 2002, 01:47 AM
#4
Fanatic Member
Ok, I read your code a little slower ...
I know a solution:
You have to put of course the result from SUM([Preis]*[Tage])/SUM([Tage]) AS [Avg Of Preis] to somewhere. It must be a field, correct? Format the result-field itself, this works for sure.
If you put the code here I can look into it. Should be a 5 minute work.
Franky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|