Percents in SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning,
I'd like to format a variable as single or double, but I would like to have
it be a fixed % format with 2 decimal points.... i.e. 42.78%. I'm not sure
what the syntax would be for that. The value will be going into a table
created by a SQL statement. I'm guessing that the field properties in the
SQL-generated table would be the determining factor, so here is my SQL
statement. Can someone please help?

Thank you!

DoCmd.RunSQL "Create Table tbl" & Pickbox & "totals ([Pickbox] text(10),
[Level] text(1), [SKUs] integer, [Pieces%] double, [ft3%] double)"

Derek
 
IMHO - you cant do this with DDL - you can do this with DAO - open tabledef
and add property called "format" to desired field with corresponding value
 
Thanks, Alex. It seems that I don't really need the percents after all.
It's outside of the scope of my project.

Thanks!
Derek


Alex Dybenko said:
IMHO - you cant do this with DDL - you can do this with DAO - open tabledef
and add property called "format" to desired field with corresponding value

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


Derek Wittman said:
Good morning,
I'd like to format a variable as single or double, but I would like to
have
it be a fixed % format with 2 decimal points.... i.e. 42.78%. I'm not
sure
what the syntax would be for that. The value will be going into a table
created by a SQL statement. I'm guessing that the field properties in the
SQL-generated table would be the determining factor, so here is my SQL
statement. Can someone please help?

Thank you!

DoCmd.RunSQL "Create Table tbl" & Pickbox & "totals ([Pickbox] text(10),
[Level] text(1), [SKUs] integer, [Pieces%] double, [ft3%] double)"

Derek
 
Back
Top