UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Decimal point location    
 
   
r3501
post Mar 15 2009, 02:02 PM
Post #1

New Member
Posts: 5



I'm developing a database to import data from a remediation system that logs data (every second) on a usb flash drive. Some of the information that is logged includes, air flow rate, air temp, etc.
The problem is that for each variable (flow rate, temp, etc) the data consists of a string of digits.
For example;

Inlet Air Flow XXXX
Inlet Temp XXXX

Some where within these strings, a decimal needs to be placed. Luckily for me, I've been provided a "cheat" sheet that identifies the locations. Therefore, the above examples become:

Inlet Air Flow XXX.X
Inlet Temp XX.XX

I'd say that I'm an intermediate user to Access; but poor on programming. I fear that this may be a programming problem; although, there may be some built-in function that can deal with this that I'm not aware of.

Any help would be greatly appreciated.
Go to the top of the page
 
+
argeedblu
post Mar 15 2009, 02:42 PM
Post #2

UA Forum + Wiki Administrator
Posts: 12,000
From: Sudbury, Ontario, Canada



Simple concenation formulas should solve the problem. If you are capturing the data using a query you could create two calculated fields in the query.

In the first empty column of the query design enter this: AirFlow: cdbl(left([inlet air flow],3) & "." & right([inlet air flow],1)) In the next column's field row enter this Temp: cdbl(left([inlet temp],2) & "." & right([inlet temp]),2))

Be sure to replace [inlet temp] and [inlet air flow] with the names of the relevant fields in your data source. As I have written the expressions the results will be doubles. If the data type of the destination fields is not double you will have to use a c...() function that returns the correct data type.

Glenn
Go to the top of the page
 
+
r3501
post Mar 15 2009, 07:58 PM
Post #3

New Member
Posts: 5



Thanks for the suggestion. I will try it out in the coming days.
Go to the top of the page
 
+
argeedblu
post Mar 16 2009, 03:44 AM
Post #4

UA Forum + Wiki Administrator
Posts: 12,000
From: Sudbury, Ontario, Canada



You are welcome.

Glenn
Go to the top of the page
 
+
r3501
post Mar 21 2009, 09:29 AM
Post #5

New Member
Posts: 5



Glenn,

I've finally got around to this, works well. However, in datasheet view I have duplicate fields; the calculated ones and the originals. How do I drop the originals from showing and being passed on through other queries?
Thanks.
Go to the top of the page
 
+
argeedblu
post Mar 21 2009, 10:29 AM
Post #6

UA Forum + Wiki Administrator
Posts: 12,000
From: Sudbury, Ontario, Canada



In the query grid, there is a row of checkboxes called Show. Uncheck the boxes for the fields you do not want to display.

Glenn
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 12:34 AM