Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:54:55+00:00 2026-06-05T07:54:55+00:00

my problem is rather simple (i think), but I just can’t make it work.

  • 0

my problem is rather simple (i think), but I just can’t make it work. I have numbers in a field that look like this 1;2.3 but sometimes they look like this 1;2.3 – 4;5.6
What I have to do is:
If there is the ‘-‘ char, get the first part (1;2.3). Otherwise get the whole thing.
I did something to get the left part

Left([age_years];InStr(1;[age_years];" - ")-1))

but when there is just one part it gives me a #Func! result.
So I tried

mths: IIf(InStr([age_years]>0;"-");[age_years];Left([age_years];InStr(1;[age_years];" - ")-1))

but it didn’t work at all. Gave me just a bunch of #Error!, and I cannt see what I’m doing wrong.

Help please!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:54:57+00:00Added an answer on June 5, 2026 at 7:54 am

    How about:

    IIf(InStr([age_years];"-")=0;[age_years];Left([age_years];InStr(1;[age_years];" - ")-1))
    

    You need to decide between ” – ” and “-“, I have left it, but you should pick one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just started with PHP and have a rather simple problem I can't
So I have a problem that I think is quite common but I have
I've run into an rather irritating problem in java. I have a program that
I feel like this is a rather simple question, but I can't seem to
Ok, what I'm doing is (I think) rather simple. I have a LINQ-to-SQL data
I have encountered a rather nasty problem with the DataGridView control (Windows.Forms, .NET Framework
Im having rather an annoying problem. I have a class called Person and a
So I have a rather basic javascript problem which I have been slamming my
I have the following tricky problem: I have implemented a (rather complicated) class which
I'm new to Latex so hopefully this is just a simple problem. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.