Thousand separator in union query

hgus393

Registered User.
Local time
Today, 07:33
Joined
Jan 27, 2009
Messages
83
Hi all,

I am trying to format my union query with a thousand separator but it is not working all that well. This is what I have so far. Does anyone have a clue?:confused:
Bob

Code:
SELECT [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ## 0.00") AS FROM [a]
UNION SELECT  [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ## 0.00") AS FROM [b]
 
SELECT [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ## 0.00") AS FROM [a]

You are naming your column "From", you dont have an alias form your formatted column...

Try
SELECT [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ##0.00") AS Somethign FROM [a]
 
SELECT [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ## 0.00") AS FROM [a]

You are naming your column "From", you dont have an alias form your formatted column...

Try
SELECT [DATE],[CATEGORY], [X],FORMAT([SumOfAmount],"# ##0.00") AS Somethign FROM [a]

Right tired that, and it works except for amount that is for example 0,233 then it returns 000? Any clues?
bob
 
You "tired" that?? LOL

Check your regional settings... The "." is probably set as Thousand seperator...
 
You "tired" that?? LOL

Check your regional settings... The "." is probably set as Thousand seperator...

Doh! He he yeah I mean of course tried..Will check it out
Thx
 

Users who are viewing this thread

Back
Top Bottom