Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 01-21-2008, 06:23 AM   #1
inoxo
Registered User
 
Join Date: Sep 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
inoxo is on a distinguished road
Arrow Create 9.99 column with SQL query

Hi,

I made a SQL query which creates a new column and initialize it to 0.00 :

SELECT ... , 0.00 as Amount, ... INTO ... ;

This is within a procedure. Once running, the column is created in the table BUT with Long integer format. I would like to create the column with Double format so I can store later numbers with 2 decimals.

How could I do to force Double format for the new column when I create it with my SQL ?

Thanks in advance,

ixo

inoxo is offline   Reply With Quote
Old 01-21-2008, 11:15 AM   #2
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,289 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
Code:
SELECT ..., CDbl(0) as Amount, ...
__________________
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote
Old 01-22-2008, 12:26 AM   #3
inoxo
Registered User
 
Join Date: Sep 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
inoxo is on a distinguished road
So simple ... and it works !
Thanks Lagbolt

inoxo is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL statement in VBA tmercier Modules & VBA 22 03-14-2007 08:41 AM
User Defined Show/No Show Query Results lauriphi Queries 10 07-08-2005 06:17 AM
SQL Query: Having 'OR' clause causes problems rusco Queries 3 11-20-2004 09:26 PM
? Convert Access Query to SQL Query eforce General 2 01-24-2003 12:21 AM




All times are GMT -8. The time now is 12:44 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World