Remove Comma From String In Query

Mar 8, 2006

I have this query:

INSERT INTO 1_2_06 ( Issue_ID, Assigned_To, ListType )
SELECT Issue_ID, Assigned_To, 'QPT'
FROM QPTActions
WHERE QPTActions.Entry_Date<=DateValue('1/2/2006') And QPTActions.Close_Date>DateValue('1/2/2006');

The Assigned_To values are a Lastname, Firstname format as they come out of the first database. But I need the comma stripped before they get entered into the INSERT database. Is it possible to do this on the fly?

View Replies


ADVERTISEMENT

Modules & VBA :: Multiple Selection List / Comma Separated String - Run Query And Create Report

Jun 18, 2013

I'm using Access 2007.

So far I have a Multi Select enabled list on which the user selects the serial numbers they want. They then click the "Report" button which will trigger a query based on the selected serial numbers to create a report on those serial numbers.

I have the code for the multi-select list working already. It creates a string of comma separated values that are the serial numbers which are selected in the list. Somehow I need to pass this string to my query so it can use it as a filter.

Here is some of my code:

Code:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim oItem As Variant
Dim bFound As Boolean

[Code] ....

Here's my current query in SQL:

Then finally how to I get the query to execute and create a report based on all of this?

View 11 Replies View Related

How Do I Trim Comma Space At The End Of A String?

Feb 4, 2005

I have a list box with an onClick that grabs the selection(s) made and pops them into a textbox on another form seperated by a ", ".

I don't want the last selection made to end with the ", "

txtselection = strList
Forms!FormName![txtselection].Requery
Trim ([txtselection]Right(", "))

How do I use the Trim and Instr function to remove a ", " at the end of the string?

View 3 Replies View Related

General :: Removing Comma From String

Jun 19, 2015

I would like to remove the comma, but only one that is at the end of my string(there is a space after the comma, should be also removed).How should I do that in vba?

View 2 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

Queries :: How To Remove A Digit From String

Jul 29, 2014

I have a field called PropertyID which stores a unique 13 digit number, the 10th digit is always a 3. I want to remove the 3 to leave a 12 digit number.

I've tried running an Update query using Replace([PropertyID],"3","",10,1) but no joy, what am I doing wrong?

View 10 Replies View Related

Queries :: Remove A Character String Using SQL?

Apr 19, 2013

I have a weight field that I've been populating with the weight and the unit of measure. I want to seperate those into 2 different fields. I've created a new field called UnitofMeasure and now I need to go back and remove all the instances of 'oz' and 'lbs' from the first field.

Is this possible with SQL?

View 5 Replies View Related

Queries :: IIF Statement - Remove Character From String

Dec 3, 2013

I'm creating a string with an IIf statement and placing a comma between values. How do I delete the last comma at the end of the resultant string?

View 2 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

Queries :: Remove HTML And RTF Tags From String

Dec 5, 2013

I'm using Access 2010.

I'm trying to append some text to a field used for comments for a Team Member profile. I don't really want to create a comments table for multiple comments regarding changes to the profile.

Some comments already exist and I want to add some more information programmatically when the profile is updated using a batch update at the end of a reporting period.

I thought it'd be easy in a query,

New Comment:[EXISTING COMMENT] & "; Additional Comment" But I was getting HTML Tags when I tried to concatenate the strings. "<div><font color=black> EXISTING COMMENT HERE </font></div>" then a linefeed and <div> </div>; Additional Comment HERE.

I found a function to kill all the html tags but the visual linefeed and the " " tag won't go away.

I'd like to concatenate two pure text strings to get one pure text string to put back into the comments field which will just be text wrapped with no forced linefeeds.

View 3 Replies View Related

Syntax Error (comma) In Query Expression

Sep 17, 2007

Hello, first time posting, not sure what info you all need. I'm looking for some help with an if/then statement in access query involving dates. Below is the query I am trying to use, along with the error message. Any ideas?

Domestic Violence CME Required?: IIf(([Date of Next Medical License Renewal]-[Date of Last Domestic Violence Credit (2)])>("yyyy",6),"yes","no")

syntax error (comma) in query expression 'IIf(([Date of Next Medical License Renewal]-[Date of Last Domestic Violence Credit (2)])>("yyyy",6),"yes","no")'

The error seems to be in relationship to the number 6. I want a "yes" to show up in the field if the difference is greater then 6 years.

View 2 Replies View Related

Queries :: Syntax Error (comma) In Query Expression

Jul 31, 2013

Access and receive the following message after trying to run a query: Syntax error (comma) in query expression, followed by the formula I wrote on the Query Builder. I use 4 tables to run the query, but only need to trim some stuff from one of them. This table is called BD_lamosa_corregida and have already selected Expression on the Total row in Design View. This is the formula:

parte: Trim(IIf(IIf(IsError(InStr(1,[Parte],"(",1)),"",InStr(1,[Parte],"(",1))="",[Parte],Left([Parte],IIf(IsError(InStr(1,[Parte],"(",1)),"",InStr(1,[Parte],"(",1))-1)))

The formula is trying to trim the left side of an expression (Part description) which may contain a code number in parenthesis or not, it might also have this parenthesis separated by a space or not.

View 1 Replies View Related

Queries :: IIF Statement - Syntax Error (comma) In Query Expression

Aug 4, 2015

I'm trying to run a very basic iif statement to correct hourly data for sorting. Basically, a trading day runs from 8am - 8am, so I need to adjust the hours to ensure that 1am on the 15th trading day (really the 16th on the calendar), comes after 9am on the 15th trading day (which will actually be the 15th on the calendar).

Here's what I've used. It's driving me bananas, because it keeps telling me that there's a syntax error (comma) in the query expression, but I can't understand why?

Sort2: IIf([DELIVERY_HOUR]<8,[DELIVERY_HOUR]+24,[DELIVERY_HOUR])

View 14 Replies View Related

Queries :: Creating Query From External Comma-delimited List Of Words

Mar 25, 2013

I have a table (let's call it "tableA) with about 7 fields. One of the fields contains information that I need to do a query on so that I may find specific payees, for example:

The field is called "Payee" and in that field for each record, the information could be "At&T", "A T and T" or "Abercrombie & Fi", but there is also other information in that field along with At&T, etc., so the field for a record may look like this:
A T AND T MOBILI A T AND T MOBILI 10 90034 Bill Pay
or
ABERCROMBIE & FI 3042 PP 10 9111 DIRECT

Is there a way to set up another table (let's call it tableB) to have all the Payees names (such as AT&T or whatever) in it and by the push of a button (maybe macro), have a query go out and find all matches from tableB in tablea?

So, basically have the query look in tableA and find all the matches from TableB. Please understand that tableA could have records that contain the same name, but spelled a number of different ways, for example, AT&T or A T and T or ATandT or ATT. Again these names may or may not be embedded in with other information in a field.

Or is there a way that an Access query can look into an external list and find the records, example:

Have a text (file) list with all the names (separated by a comma or space - AT&T, AT & T, Amercrombie and FI, Abercom&Fitch, etc. Now have a query go to that list and find all records that match in my tableA?

View 3 Replies View Related

Query To Remove - And /

Oct 1, 2005

I have an access database and table name called student. The table includes field name such as identification_id and registration_no. The value in identification_id is 3434-34-213 and registration_no are 234/45. Can i query the field name so i can get both value without the sign - and / so the output will be 343434213 for identification_id and 23445 for registration_no?

View 5 Replies View Related

How To Use Query To Remove Info

Aug 17, 2005

Is there any way I can remove specific information from all the records in a field using a query?
For example- how could I write a query that would remove the "NME" from NME ACTIVE; FENCE CO INC? I know you could add text to a field by including & "text".

View 1 Replies View Related

Remove Null Records From A Query ?

Aug 4, 2005

Hi, I have a query which works perfectly and deletes the unnecessary records according to the criteria i have set , but i dunt want this null values in all column to display in the exported output file. how do i delte the records which are already null .
i tried delete query but it did not work

Please help me

View 1 Replies View Related

Remove Null Records From A Query ?

Aug 4, 2005

Hi, I have a query which works perfectly and deletes the unnecessary records according to the criteria i have set , but i dunt want this null values in all column to display in the exported output file. how do i delete the records which are already null .
i tried delete query but it did not work . This is in microsoft Access.

Please help me

View 3 Replies View Related

Remove Duplicates From Query/form

Nov 10, 2005

Hi,

I have the following set up on a form to pull together a query (by form) and resulting report:

Publication
Sector
Product
Region

Each publication can have multiple sectors/products/regions. The resulting query therefore duplicates the publication, for example:

Publication 1 Sector 1 Product 1 Region 1
Publication 1 sector 2 product 1 region 1
publication 1 sector 2 product 2 region 1

etc etc...

The report ONLY has publication on it, but as it is based upon the query utilising the 4 factors above, the resulting report is:
Pub 1
Pub 1
Pub 1
Pub 2
etc

I want the report to only list the publications once - i have tried "hide duplicates" from the form field properties, however this hides the text but leaves a big gap on the resulting report when generated where the duplicate would be if it were not hidden.

There must be a simpler way to acheive this than getting another query to create a table based on the first query which (the table) only includes the publication name, and is filtered to remove duplicates through a primary key...

Can anyone help!?

cheers
amx

View 1 Replies View Related

How Can I Remove The Last Alpha Characters In A Query?

Aug 16, 2007

I have field called [LOCATION] that varies in length. I need to remove any alpha characters at the end, if there are any. Listed are some examples.

[LOCATION] [NEEDED]
PA 109S 55W 2N 1A PA 109S 55W 2N 1
WC 155A WC 155
PB4 68N 1UNH PB4 68N 1
B 3E 1P B 3E 1
XB1 203S 14W 2N 6PU XB1 203S 14W 2N 6
PB1 6 PB1 6
Thanks!

View 5 Replies View Related

Update Query To Remove Spaces

Jan 25, 2008

Hi,

I'm trying to run an update query on a field called "DisplayURL" to remove all of the spaces that the field contains. Some have 1 space, some 5 and some have no spaces.

I'm using Access 2000 and the replace function ( Replace("DisplayURL"," ","") or Replace([DisplayURL]," ",""). However it produces an error stating that there is an "Undefined function "Replace" in expression".

I've searched online and found that Access 2000 doesn't have this function, but its easy to create a "wrapper" to make it work.

I've tried various examples online with no luck. Does anyone know what "module" I'd have to create to get this working, and how to "call" the function as I do not understand how to do this?

Thanks in advance for your help, I've been having a nightmare with this problem.

Thanks again.

Dean

View 5 Replies View Related

Remove Append Query Messages

Dec 22, 2006

Hello friends,

I have slitted my database and given each user a copy of the front end so tha I can work on the master. I have notice that each time I sent them an updated copy of the new file once they replace the old one in their C drive, when they run a push button which makes run certain append queries, I have noticed that the message comes up although I have removed it from the Options settings. I was wandering if there was a way I can exclude this via code. THank you.

View 1 Replies View Related

Remove/hide Unwanted Fields In A Query

Jan 11, 2005

I have a query which contains about 19 fields in it and some of the fields contain parameters. What I'm trying to do is to run the query using the parameters I've set, but at the same time remove fields that are empty (therefore only fields that are populated will be shown). I've tried using the 'is not null' parameter but it seems to interfere with the other parameters that I've set and as a result the query doesn't show any information. Also the field containing the 'is not null' parameter is still being shown. I'm not really sure what else to try!! Any suggestions would be most appreciated!!

View 14 Replies View Related

Queries :: Remove MsgBox Created From A Query

Sep 26, 2013

Here is the SQL from my Query

SELECT PreStatus.Operator, PreStatus.Mode, Sum(PreStatus.CountOfMode) AS SumOfCountOfMode, IIf([SumOfCountOfMode]>=3,"YES","NO") AS [Current], PreStatus.Rate, PreStatus.Last, PreStatus.First, PreStatus.DET
FROM PreStatus
GROUP BY PreStatus.Operator, PreStatus.Mode, IIf([SumOfCountOfMode]>=3,"YES","NO"), PreStatus.Rate, PreStatus.Last, PreStatus.First, PreStatus.DET
HAVING (((PreStatus.Rate) Like "*" & [Forms]![Status]![Rate] & "*") AND ((PreStatus.Last) Like "*" & [Forms]![Status]![Last] & "*") AND ((PreStatus.First) Like "*" & [Forms]![Status]![First] & "*") AND ((PreStatus.DET) Like "*" & [Forms]![Status]![DET] & "*"))
ORDER BY PreStatus.Operator;

When I run Query a dialog box request for SumOfCountOfMode appears. Is there anyway I can turn this MsgBox off?This Database is used for the user to find out if their personel are current in said data. The user will be running this query through a Form and will get their results via a report if they put anything in this MsgBox it could possibly skew the data they are looking for.

View 3 Replies View Related

Queries :: Remove Message While Running Query

Sep 15, 2013

I have a count and store data INTO a table named USTATE

When I run the query it works within 30 seconds. but when i add INTO USTATE then it takes 4-8 minutes to complete it and asks for if i want to delete the existing.

View 1 Replies View Related

Queries :: How To Remove Duplicate Records From A Query

Feb 11, 2014

I have this small database, I would like to have your support to setup this query "QryResults" in order to remove the duplicate records, I can't find a way to get shown only true records, for some reason I'm getting duplicate rows and fake values, the query is calculating operations from two different queries and a table.

View 3 Replies View Related







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