Welcome to the skill header Forums. You can ask questions, get help, or help other members out. Join our Forum for free.

Standard Format of ...
 
Notifications
Clear all

Standard Format of Numbers in UNION SQL QUERY

1 Posts
1 Users
0 Reactions
38 Views
Posts: 2
Topic starter
(@khuram-shahzad)
Active Member
Joined: 2 weeks ago

Hi everone

I just want to share a valueable tip if you want to get the number format as a standard with one digit after decimal place then it can be useful if you write the SQL query in Video No: 20 

SELECT *
FROM (SELECT AcCommonID, AcSubNm AS NM, "G.Account" AS Type, AcCommonID, Nz(format([AcSubBalance],"#,##0.0"),0) AS AcB FROM tbl_ChartofAccountsSub UNION SELECT AccCode,CName AS NM, "Customers" AS Type, AccCode, Nz(format([CBalance],"#,##0.0"),0) AS AcB FROM tbl_customer UNION SELECT AccCode,SName AS NM, "Suppliers" AS Type, AccCode, Nz(format([SBalance],"#,##0.0"),0) AS AcB FROM tbl_supplier) AS [%$##@_Alias];

I have noticed that int() function outside the format() is destroying the desired output result showing numbers only but not any comma or decimal place. However i used Nz function and format fuction. It worked for me.

I dont know why our tutor used ids fields twice i.e. AcCommonID, AccCode for customers and AccCode for suppliers?


Share: