Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-18-2019, 07:35 AM   #1
itownson1
Newly Registered User
 
Join Date: Mar 2019
Posts: 43
Thanks: 5
Thanked 0 Times in 0 Posts
itownson1 is on a distinguished road
Revove decimal if two in field

I am trying to remove a decimal if it is the first character in a field.
We get weights from a set of scales that appear as .2.450 which is 2.45kg.
When manually entered there is no leading decimal so trim is not an option.
Ian

itownson1 is offline   Reply With Quote
Old 09-18-2019, 07:40 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,894
Thanks: 57
Thanked 1,287 Times in 1,268 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Revove decimal if two in field

Hi Ian. Have you tried using Left() to check for a dot? Or, you could also try InStr(). However, both functions require a String value.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 09-18-2019, 07:43 AM   #3
sxschech
Newly Registered User
 
Join Date: Mar 2010
Posts: 612
Thanks: 28
Thanked 112 Times in 101 Posts
sxschech is on a distinguished road
Re: Revove decimal if two in field

Edit your query for the field something like:
Code:
NoDec1:iif(left(fieldname,1)=".",mid(fieldname,2),fieldname)

sxschech is offline   Reply With Quote
The Following User Says Thank You to sxschech For This Useful Post:
itownson1 (09-18-2019)
Old 09-18-2019, 09:51 AM   #4
itownson1
Newly Registered User
 
Join Date: Mar 2019
Posts: 43
Thanks: 5
Thanked 0 Times in 0 Posts
itownson1 is on a distinguished road
Re: Revove decimal if two in field

Once again, thank you very much. Worked perfectly.
itownson1 is offline   Reply With Quote
Old 09-18-2019, 11:12 AM   #5
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,894
Thanks: 57
Thanked 1,287 Times in 1,268 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Revove decimal if two in field

Quote:
Originally Posted by itownson1 View Post
Once again, thank you very much. Worked perfectly.
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   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
Decimal Field Type Using SQL Leigh46137 Modules & VBA 7 07-22-2017 08:02 AM
Decimal number field goodfu Tables 7 11-28-2013 08:56 AM
a problem with decimal field tooty SQL Server 1 01-23-2006 09:14 AM




All times are GMT -8. The time now is 08:43 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