SQL Server import into Access (1 Viewer)

ptodd

New member
Local time
Today, 12:19
Joined
Mar 24, 2015
Messages
8
I'm getting a strange occurance when importing orders from a SQL server table. For a little background, I'm using SQL Server 15 and MS Access 365. I am bringing orders into SQL from our website with an API. From there I'm running a series of stored procedures to import them into our Access front end. This has been working fine for months. Now all of a sudden, one of the fields is acting strange. In SQL the field type is decimal (18,2) and in access it is fixed with 2 decimal places, The field is "Custom Price". When the import is run, you can see that the price either shows 0.00 or some other value such as 79.20.
However, when the user starts tabbing through the fields in Access (this is needed to perform some back ground calculations), when they get to the "CustomPrice" field, it inserts a blank. Not the "0" or the 79.20.
Any ideas on what could be causing this?
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 03:19
Joined
Jan 20, 2009
Messages
12,852
Access probably isn't going to like decimal(18,2) because it has no equivalent.
decimal is a scaled integer and I doubt Access would handle an 18 digit integer even inside a decimal.
The values are money so why not use money datatype?
 

Minty

AWF VIP
Local time
Today, 18:19
Joined
Jul 26, 2013
Messages
10,371
In the access table, what is the data type for the field showing as?
 

Minty

AWF VIP
Local time
Today, 18:19
Joined
Jul 26, 2013
Messages
10,371
You can set the number field size to decimal and set a precision as per the settings below:
1683727908446.png


That should mimic the same datatype as SQL server.
 

Users who are viewing this thread

Top Bottom