Pull Out Part Of The String Within Cell

Sep 10, 2013

I'm trying to find a function in access that could do the following:

ZAB103-3012
ZAF405-HD-0001

Turn those cells into:

AB103
AF405-HD

Pulling everything to the right of the Z in the last step is the easy part but I can't figure out what function would be able to find the last "-" in the cell and pull everything to the left of it.

View Replies


ADVERTISEMENT

Getting Specific Part Out Of A Cell?

Jul 15, 2015

how do I extract the number of dates and number of percentages out of a cell?

I have for example: "within 10 days 5% discount".

In this it is always "days" and "discount". So I would expect something like 4 digits left of "days" and something like: 3 digits left of "discount".

View 6 Replies View Related

Ok Pull From Form Part 3

Aug 15, 2007

Code:INSERT INTO [Status Log] ( Status, Edit_Date, Event, Claim_ID )SELECT [Status Lookup].Status, Now() AS Expr1, "3rd Party Denial" AS Expr3, [Claim Report Info].[Claims Header].Claim_IDFROM [Status Lookup] RIGHT JOIN ([Claim Report Info] LEFT JOIN [Status Log] ON [Claim Report Info].[Claims Header].Claim_ID = [Status Log].Claim_ID) ON [Status Lookup].status = [Status Log].StatusGROUP BY [Status Lookup].Status, Now(), "3rd Party Denial", [Claim Report Info].[Claims Header].Claim_IDHAVING ((([Status Lookup].Status)=[Forms]![claiminformation]![ReportForm]![reportstatus1]) AND (("3rd Party Denial")="![claiminformation]![ReportForm]![txthiddenvalue]") AND (([Claim Report Info].[Claims Header].Claim_ID)=[Forms]![claiminformation]![ReportForm]![Report_ClaimID]));

here is my current query.
i'm trying to append data to a table from my form.
"![claiminformation]![ReportForm]![txthiddenvalue]"
but since it's my value from txthiddenvalue isn't anywhere in my query how do i get this to work?

View 1 Replies View Related

Remove Part Of A String

Feb 7, 2005

Hi folks,
I have a table with the words "Church of (whatever)" in one of the records. I am attempting to do an update query to remove the "Church of" part but leave the remaining part of the string. I am using a combination of Format and left but am not having any look. Any suggestion are much appreciated.
Thanks
Colin.

View 2 Replies View Related

Removing Part Of A String

Nov 29, 2005

I have a bunch of server names that have names like aaa.bbb, xxx.yyy. All i need from these server names is the name before the first "." so in the first example all I would need is aaa. I've been using this formula in excel MID(A1,1,FIND(".",A1) - 1). This works great.. Is there any way to do this in access?

View 1 Replies View Related

Using A String To Pull Up A Record On A Form

Feb 28, 2005

Sorry if this has been asked before but I have searched and couldn't find an answer

I have a string that is set on startup (username) and have another form(hidden) that loads on startup this form contains information on what forms and options the user can access. Just having a little trouble using the string to pull the correct record, the information in the string would be from the primary key field on the table.

Thanks

Ryan

View 2 Replies View Related

Queries :: Pull Text From String?

Apr 2, 2015

I have a text field in a Table and on a Query called "Notes" In that field that has data like below:

[04/02/2015:BD] Project is to be assessed by Solutions Planning
[03/27/2015:BD] Project prioritized
[03/14/15:BR] Entered to system

Im trying to find a way to pull just the most recent line of text, in this case

[04/02/2015:BD] Project is to be assessed by Solutions Planning

into the field next to "Notes" or wherever - an empty field in the query. I searched around, found some stuff and I was thinking of having the code look at the first "[" and count the length to the next "[" and pull out whats in between. Looks like the bracket causes issues in the module.

View 10 Replies View Related

Modules & VBA :: Pull Numbers From String And Get Max Value?

Jan 3, 2014

I have a series of IDs in an 'articles' table stored as text, e.g.

hb-123456789-e-068
hb-123456789-e-0069
hb-123456789-e-70
hb-123456789-e-00027

and I'm trying to pull the max value of the number after the -e- for a given set of them. In this example, I'd want to return the number 70. I'm then going to use that to create the next ID and populate another field.

The IDs are not used as the primary key. And while the previous IDs used leading zeros inconsistently, new IDs will not have leading zeros.

Here's what I have so far, but it doesn't seem to pull the number after the -e- at all. I think this section here is the problem, even though the same logic works in a query:

Code:
selectedERef = Val(Right(rs![masterArticleID], Len(rs![masterArticleID]) - InStrRev(rs![masterArticleID], " - ")))

Code:
Public Function MaxArticleERef(hbID As Long) As Variant
On Error GoTo err_handler
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSql As String
Dim maxERef As Variant

[code]....

View 3 Replies View Related

Queries :: OR Using Part Of String From Parameter Box

Aug 1, 2014

I have a criteria in a parameter query that asks the user to enter a Subsystem number (such as 4596-666-001).
The source data for my database has Systems (e.g, 4596-666) and each system has several Subsystems associated with it (e.g, 4596-666-001, 4596-666-002, etc). The System and Subsystem numbers are stored in the same column of the source data spreadsheet, and hence the same field in my database.

The source data is structured in such a way that Systems and Subsystems have different information. I would like to set up a query that shows the System information as well as the Subsystem information.

For example, if the user enters 4596-666-001 into the parameter dialog box the query returns all the information for 4596-666-001 and 4596-666 (but NOT any other Subsystem).

As a work around I have set up an OR situation where the user first enters the Subsystem number and then another parameter query dialog opens and they enter the System number. This works but is not as nice as simply entering the Subsystem number and having all information returned.

Is there a way to set up my query so the when 4596-666-001 is entered an OR is generated using the first 8 characters of the Subsystem number?

View 1 Replies View Related

IIF Statement To Pull String From Memo Field

Sep 12, 2006

I have a 3rd party database where I have no control over how the data is entered. I've been given the task of creating a Crystal report that would need to gather data from two databases. The link between the two databases in my report would be on a quote number. In one database, the quote number is in it's own field. In the 3rd party database, the quote number is stored in a memo field along with other data.
Here's an example:

4000 C7875
9003267 T7761
90000167/4010/T6895
4010 T7152A
TPCA #1756/2914

The data I'm after is
C7875
T7761
T6895
T7152A
*No data from the 5th row since the data after the "T" isn't numerical

So far I'm thinking of using an IIF statement to check for the existance of a C or T, then if true, use a nested IIF statement within the first to check for numeric, if true, use the Mid function to pull out the quote number.

My first concern is this could become a complicated IIF statement and was wondering if there was another direction I should be looking in acheiving this.

My second concern is if I go with this method, some of the quote numbers have a space after them, some of them have no space after them, some may even have a "/" after them. How would I go about accomplishing this?

View 5 Replies View Related

Queries :: Remove Part Of A String From Right To Left

May 28, 2015

I have a manual date format that looks something like:

02/16/2015 09:06:15 AM PST

I would like to truncate the text so that just the date is showing. For all that I have found, I can remove a string from the beginning? any tips on removing a string from the end?

View 6 Replies View Related

Splitting String Using Instr And Retrieving Part Information

Apr 26, 2006

I know there are many posts on this but still cannot find what I want ....


I have a string ....

... <surname>bloggs</surname> <fornames>Jane</fornames> etc.etc.
... <surname>williams</surname> <forenames>Jo</fornames> etc.etc.

In a query I know how to:

Find the Start and End Postions as follows:

StartSurnamePos: InStr([string],"<surname>") returns 19
EndSurnamePos: InStr([string],"</surname>") returns 34

I also know that by adding 8 to StartSurnamePos I can get Bloggs but how do I stop it there.

Using left, Right or Mid how do I pull out just

bloggs Jane
Williams Jo in seperate fields?

Thanks in advanced.

View 1 Replies View Related

Way To Make A Part Of A String That Is Calculated Into Currency Form?

Feb 28, 2012

I have a text box and currently this is my control source

="Testing " & [test]/3
test = 1000 so my text box reports:
Testing 333.333333333333

Is there a way to make it into a form like $333.33...Also is there a way to make [test]/3 come out in a money text form? like "Three hundred thirty three dollars and thirty three cents.

View 7 Replies View Related

Tricky Question - Form Part Data Entry, Part Not

Dec 16, 2004

I have what I think is a difficult problem to overcome...

I am designing a form to create an invoice. The user will select a workstream and a date range in form frmInvByHrs. Within this I want two sub-forms, one is frmInvByHrsTsht and the other is frmInvByHrsBill. I want the first one to display all the staff and their hours done, and the second one to be in data entry mode where you can enter the hours you want to bill. Each sub-form is based on a separate query.

Is it possible to do this? ie. to have one sub-form in data entry mode, and the other not? It seems to me that the data entry mode is controlled by the MAIN form regardless of the sub-form settings!

If this is not possible, do you know how I can acheive this?

Thanks

S

View 1 Replies View Related

Date Problem - Part Constant - Part Now()

Nov 3, 2006

Hi everyone,

I have refined my query from previous threads to involved a module function. This calculates more acurately no of working days between dates and takes into account a holidays table. (All credit to Arvin Meyer on the module:) )
However because the Leave Year starts at the 1 July and finishes 30 Jun I need to compose the date for any current year Year(Now())

Enclosed scrdmp shows my query design. I can easily get it to work as you see it, but obviously as each year rolls over, the year needs to change.

Have looked at many posts but can't find what I'm looking for. This one will get me over the hurdle.

Many thanks,

View 6 Replies View Related

Add Value To Cell According To Another Cell In Same Record

Nov 21, 2006

i have a table of articles. A field in the table is ArticleSubject

the ArticleID is made up of 3 letters then 3 numbers. i want the 3 letters to be something according to the subject
for example i want the first 3 letters of the ArticleID to be MAT*** (* is a number) if the subject is Maths
or ENG*** if the subject is English

the subject is picked from a listbox in the same record

how would i do this in a table . i am reluctant to use append or update queries.
but will do so if its the only way.

View 4 Replies View Related

Modules & VBA :: Separate Numbers And String From Alpha-numeric String

Jun 7, 2013

MS-Access VBA code to separate numbers and string from an alphanumeric string.

Example:

Source: 598790abcdef2T
Output Required: 598790

Source: 5789065432abcdefghijklT
Output Required: 5789065432

View 13 Replies View Related

String Validation (string Must Start With Http://)

Mar 12, 2007

Hi all,

I was looking for some help. I am trying to setup a table with a field for web address. People are entering www.website.com etc however I need them to make sure it starts with http:// Is their any way I can put validation on the field to make sure that this is entered? Or maybe I could use an input mask?

Any suggestions would be gratefully recieved.

Andy.

View 3 Replies View Related

How To Have New Cell With New Values?

Jan 9, 2007

Hello!
I have "ID" column and I want to create new column called "ID_new" where the value of each record should be "1000" plus the value of "ID".
For example:
First record, has "ID"=1, than I want "ID_new" to become = 1001
Second record, has "ID"=3, than I want "ID_new" to become = 1003
etc..


Any tips/hints?

Thank you in advance & best regards
noah

View 4 Replies View Related

Duplicating Cell

Jan 10, 2008

Hi Guys

Not sure what I should do here. I would like to have a cell populate with the value of a specific cell previously.
explain:
in excel, we can use formulas like this:

A1: 00:00 B1: 08:30
A2: 08:30 B2: 13:00
A3: 13:00 B3: 15:00
etc, etc
Notice that each cell in A is the same as the previous B Cell. So the formula for Cell A2 would be something like: =IF(B1>0,B1,"00:00")
and Cell B3 would be =IF(B2>0,B2,"00:00")

The fields I have in Access are:

TimeIn TimeOut

So I would need to get TimeIn to be the same as the previous timeout???
Not sure If I'm making any sense right now :)

View 5 Replies View Related

Copy Cell Above And Add 1

May 2, 2005

I have a subform in Datasheet view. One field contains numbers. When entering data into the datasheet I wish to copy the number from the cell above and add 1. Can anybody help me with the code to do this?

View 5 Replies View Related

Format Cell Color

Oct 19, 2004

This is a very stupid question, I'm sure...
I want to get Access to find a cells that have a certain value and make them a particular colour so that they can easily be seen by database users. I could also make the font a different colour. I've tried getting the builder to do this in the query I run (for the column the fields appear in) but nothing seems to work. How and where do I enter formatting for colour / font colour based on data that is already in the cell... and what do I need to type?

Also would it be faster to get Access to do this before I run a query - so that the formatting is appllied to the whole table or would it be faster to do it during the query process?

Any help would be much appreciated.

View 2 Replies View Related

Sub Cell Information In A Table

Aug 9, 2005

I am not sure if this has been done in a table before. I have seen it in forms but not in tables.

Here is my problem.
I have created a database for a planespotters club. This database has the tables.
ac_logged
ac_maker
ac_model
country
airport

I am trying to display selected information in the ac_logged tbl that is related to other cells. For example: If someone selects boeing in the maker field they will only boeing models in the model field. Also, if someone enters Ireland in the country field only the airports for that country would be listed.

I don’t want to do this in a form but I could settle for a query if I have to.

I was just wondering if this could be done in a table as opposed to any other way.

Hope I have made myself clear on this one. :confused:

View 6 Replies View Related

Replacing Cell Value In A Table

Aug 1, 2007

OK, here is my situation. I have an access database which is updated automatically every night with new data. My companies solution to this is each morning, the entire database is downloaded to my computer to be used by another application.

In one of the tables, there is a field that doesn't work for my purposes, so each day I have to manually open the table, and change the contents of that field for every record. For example, lets say I have the following table:

Field1 Field2 Field3 Field4
Rec1 Wigets Faucet Model1A
Rec2 Wigets Faucet Model1B
Rec3 Wigets Sink Model1A
Rec4 Wigets Sink Model1B
Rec5 Wigets Toilet Model1A

Each day I manually change Field2 so it reads "Total" and whatever is in Field2:

Field1 Field2 Field3 Field4
Rec1 Total Faucets Faucet Model1A
Rec2 Total Faucets Faucet Model1B
Rec3 Total Sinks Sink Model1A
Rec4 Total Sinks Sink Model1B
Rec5 Total Toilets Toilet Model1A

Each morning when I receive the new database download, they all go back to widgets.

Is there a macro or module I can create to automatically look at Field3, and then assign a new value to Field2 based on Field3's value?

Any help would be appreciated!!!!

View 3 Replies View Related

Value Of A Specific Cell From A Subform

Nov 4, 2005

Hi experts,

I have a mainform in which there is a subform. Is there any way that I can retreive the value of the selected cell of the subform in the main form?
Currently what I usually do is that using a text box and setting it's control source to that special field in the subform, we have the value. But this is only for a specific field.
To explain my problem more precisely, I have a subform with 7 columns (fields) and 5 or 6 rows (datasheet view). When I click with the mouse on a specific cell ( or navigate within the subform with the arrow keys) I want to have the value of that cell in my main form.
Thanks in advance.

View 3 Replies View Related

Excel Cell Value Not Same As Value Written To It

Feb 14, 2008

Has anyone else had this problem?

I have a program that brings in the upper and lower specs to a excel spreadsheet and then brings in the values from lab tests.

The program then uses the specs to determine if the value is in or out of spec and colors the value if it is out of spec.

My problem is that in one cell the upper spec that is brought in is 2.7 and it shows that on the spreadsheet but when you click the cell the true value stored there is something like "2.66990153". Since a test value of 2.7 is greater than that it colors it when it is in fact in spec.

I have stepped through the code and the spec value pulled from the table is coming in correctly at 2.7.

Why would the excel sheet have a different value?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved