Format question

  • Thread starter Thread starter PC
  • Start date Start date
P

PC

Hi,

Is there a way I can make this work? When run I'm receiving a syntax error

Select Format(Round([Amount]*[VatRate]*0.6,2)*100, "00000000000000000)"& "0"
As OtherAmount
From tblInvoices

I know its close because this works fine. (Example result 000000000000012740
from 12.74)

Select Format([Amount]*100, "00000000000000000)"& "0" As OtherAmount
From tblInvoices

These are excerts from a union query which is used to create a text file
which will be imported into another application. The format of the text file
is quite specific hence the unusual format requirements.

Any ideas appreciated.

Paul
 
Is there a way I can make this work? When run I'm receiving a syntax error

Select Format(Round([Amount]*[VatRate]*0.6,2)*100, "00000000000000000)"& "0"
As OtherAmount
From tblInvoices

It looks to me like you've got the parenthesis and quote reversed: try

Select Format(Round([Amount]*[VatRate]*0.6,2)*100,
"00000000000000000") & "0"

or to save a step, multiply by 1000 to get the extra zero instead of
appending it:

Select Format(Round([Amount]*[VatRate]*0.6,2)*1000,
"000000000000000000")
 
Back
Top