Re: Need help formatting Float data type for leading zeros
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 04/13/04
- Previous message: ALEX LEE: "SOURCE CODE"
- In reply to: Zachariah: "Need help formatting Float data type for leading zeros"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 16:25:12 +0200
On Tue, 13 Apr 2004 06:01:06 -0700, Zachariah wrote:
>I have an existing query in Access 2000 that I'm converting to a SQL view. One of my returned columns current syntax is:
>
>Format([tblFoo.NoteAmount]), "00000000.00") AS NoteAmount
>
>If I give it a value of 10400.56 it will give me 00010400.56 as NoteAmount in the resulting data set.
>If I give it a value of 94.00 it will give me 00000094.00 as NoteAmount in the resulting data set.
>
>I can't seem to port this to a view. the "FORMAT" function isn't allowed and I can't get the NoteAmount which is a Float data type to cast or convert the way I want it.
>
>Any ideas?
Hi Zachariah,
The best solution is to do all formatting on the front end.
The second best solution is:
SELECT RIGHT('00000000'
+ CAST(CAST NoteAmount AS Money) AS varchar), 10)
By the way: if the contents of NoteAmount are what it's name implies,
you'd probably be better off using datatype money instead of float.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Previous message: ALEX LEE: "SOURCE CODE"
- In reply to: Zachariah: "Need help formatting Float data type for leading zeros"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
- Re: Jargons of Info Tech industry
... YOU are confusing HTML email with formatted ... I've hated HTML emails
well before I received my first spam. ... allowing formatting in emails, I'll consider
it. ... (comp.unix.programmer) - Re: Xml schema
... create XML schema using VS.NET, VS.NET uses the wrong formatting (If I ...
> I can't believe that it is like this as it should be a standard. ... (microsoft.public.dotnet.languages.csharp)