Using The Left Function Inside A "NOT LIKE" Comparison

Jun 29, 2006

Hi, I'm trying to compare 2 name fields to see if the last name of one field is found in the last name of the other field. In table A, the name is stored as LastName, FirstName. I've used the Left and InStr function to extract the last name successfully.
In Table S the name is stored as separate fields, Lastname and Firstname.

In a query I am trying to determine if the last name from table A appears in the last name field in table S

(s.lname Not Like '*Left([a.name],InStr([a.name],",")-1)*')

the problem I think I'm encountering is that I want access to see this statement as:

(s.lname NOT LIKE '*JOHNSON*') instead of searching for the Left function string

is there any way to put the value of the function in there without actually searching the function literally?

I tried [ ] and that didn't work.. any ideas? thanks!

View Replies


ADVERTISEMENT

Calling An Access Function From Inside Of WORD

Oct 5, 2005

My title may not accurately express my question. If you can suggest a better way to do this, please feel free to elaborate.

Within Access, I have an "Invoice Number" table, with a single field containing a number. I have a function that accesses the table, increments the number and returns it to the invoice number field.

I need a way to perform this same function to the same table from within WORD.

I appreciate your time and interest.

View 1 Replies View Related

Using Left Function

Jul 20, 2005

I have a column in access containing codes in format K2316 and wish to remove Prefix (K) from this code.

How can i do this as a calculated field?

thanks

View 14 Replies View Related

Left Function

May 17, 2006

Hello,

I have used the left function to provide me with the left x characters of a field, which works fine.

Description: Left([c$products],[diff])

However, I want to query this field to only give me certain descrpitions, but it will not work.
Can anyone let me know if this is possible, or if I'm totally out of luck,

Thanks,

J.

View 4 Replies View Related

Need Some Help With A Left Function

Sep 13, 2007

I have an imported table with zipcodes, some are 5 digit some are 9. When i go to build my query i dont get an accurate number, i tried a left function to get the 1st 5 digits but keep getting a invalid syntax. I am in the query builder. anyone help me with syntax, heres what i currently have

Mail Zipcode «Expr» Left («stringexpr», «n»)

View 3 Replies View Related

Left Function

May 2, 2005

Hi all - I have a database that has only 1 field of patient names (e.g., "Johnson,Peter S"). I also have a form that allows clinicians to lookup their patients and I want them to be able to type in the last name of their patient and get the info they need. Anyone know how to pull just the part of the name BEFORE the comma (i.e., the last name only)? The Left function won't do it because the last names are different lengths.

Also, is there a way to have the form pull all the names after each letter they enter? So when the user typed "J" it would pull Johnson, Jones, Jackowa, etc, but when they typed the "o" it would decrease the list to only Johnson and Jones.

Any thoughts would be great. Thanks.

View 4 Replies View Related

Run A Function Every Minute While A User Is Inside Of An Access 97 Database?

Aug 19, 2004

I am using a Access database with a frontend/backend design. I want to keep a table in the BE updated with the current list of users inside of the frontend. To do this I thought that I would just have the front end update a time field saying that that user is still inside of the FE. My question is two-fold - firstly, how can I run a function every minute or so to update this table.

Secondly - is there a better way to do this?

Thanks in advance for any help you can offer.

View 3 Replies View Related

Probelm With Left Function

Mar 11, 2006

Hi there,

I have a query with Expr3: Left([POK],2) as one of my fields.

Whenever I try to run the query it pops out a message window saying

Syntax error (comma) in query expression.

Please tell me what I am doing wrong.

Thanks in advance.

View 2 Replies View Related

Left Function In IIF Statement

Feb 4, 2008

Hi, hope someone can help me. I want to run a query which acts on data in a table which has been imported from excel, where it was somewhat mangled. Basically, the field shows telephone numbers, but the leading zeros on the phone numbers have mostly been discarded. I want to replace the zeros if they're missing. (Here in the UK phone numbers always start with zero). What I'm trying to use is:
IIf(Left[fieldname],1)="0",[fieldname], "0" &[fieldname]))
But I get errors, I think maybe because of the first comma(?). Can anyone tell me how to achieve this? Any suggestions appreciated.

View 2 Replies View Related

Update With Left Function

Jan 9, 2012

I have a column with a date in it, and the left four characters are the year. I want to add another column that is just the year. I've tried doing an update query and updating the year column to left(date,4) but it doesn't work. How should I go about updating my year column?

View 3 Replies View Related

'Left' Function No Longer Working??

Jan 8, 2008

I developed a database in 2005 and used the 'Left' function in many of the queries to obtain the the correct text for output to reports. The database worked extremely well for a year and a half.

I have not accessed it for the past year. Recently I opened the database for use with a new project and I keep receiving the error message:

! Undefined function 'Left' in expression.

I haven't changed any of the expressions and do not understand why this funtion no longer works.

Any ideas?

Thanks

View 5 Replies View Related

Possible To Use Function: Left(Field,4) In A Query?

Aug 19, 2006

Hi!In my query i'd like to format a selected field.At the moment i write it like this:MyOwnFieldName:[Table].Field I want to achieve:MyOwnFieldName: Left([Table].Field, 4) & "-" & Right([Table].Field, 4).Is this possible?Thanks for helpful feedback ;)

View 5 Replies View Related

Left Function To Extract First Four Characters

Nov 27, 2006

I have seen variations of this question and have tried to modify for my purpose, but have been unsuccessful. I need to extract the first four digits of the Social Security Number. We no longer view the whole number, but a variation of the first four of social and first four of first name. I have tried many variations of the Left Function to extract the data from the field:

Expr1: SSN(Left([SSN],4))
Expr1: Left([SSN],4)

Etc.
I get various errors, mostly involving the comma. I am at a loss since I usually search for the code and find that it works. In this case, it doesn't work. I am also trying to extract the first four of the first name and will later combine the two although I broke it down since I couldn't get the basic "left" function to work.

Please help if possible. :)

View 11 Replies View Related

Queries :: Left Function With 2 Static Characters

Jul 23, 2015

I have to query a record with 2 of the same static characters. "-".I can get the left function with the first " but I can't get the rest up to the second "-"

Example: B-4352B-PXP02W01-10

TagNo: Left([EventInstanceID],InStr([EventInstanceID],"-")) Brings me the first char plus "-" The next section is needed also but the remainder is not.

Needed: B-4352B

Is there a Mid Function that I could add to go to the second chaacter instead of stopping at the first one?

View 6 Replies View Related

Between Function - Show All Records If Left Blank

May 10, 2013

I am creating a query which uses 2 unbound text boxes to populate a Between function for 2 date fields. If I fill in the dates, it returns the corresponding data. If I leave them blank, however, it returns no records. Is there an easy way to tweak the query to return all records if left blank?

View 4 Replies View Related

Queries :: Left Join On A Query After ConcatRelated Function

Nov 2, 2014

I managed to produce a working Query with AllenBrowne's ConcatRelated function.What i'm unable to do is a new query with left join on the result of the query using the ConcatRelated function.I get error 3075: syntax error (missing operator) in query expression (free translation - MS ACCESS not English version)

If I do the normal join then it works fine, but I only get rows for which there are related concatenated values. But I do also need those rows where there are no concatenated values' fields.

View 1 Replies View Related

Queries :: Left Function - NOT Ignore Leading Zeros

Aug 3, 2015

In my table I have a numerical field for case numbers. Our case numbers are in the format of YYMM000000 (YY = 2 digit year, MM = 2 digit month, remaining 0's are consecutive case numbers). In order to properly list the case numbers in descending order, I have

caseyr: Left([CaseNo],2) (which pulls the first 2 digits being the year)
officeno: Right([CaseNo],3) (which pulls the last 3 for our part of the case number)

This was working fantastic until I had to enter cases from 2009, ex: 0911000587

I have set the format for the CaseNo field to 000000000 everywhere it is. It displays the 09 cases perfectly, retaining the zero, however, my left function ignores it. In the case number of 0911000587, it pulls 91 as the first 2 digits. So, in the form that I list my cases in order, the 2009 cases are showing up first (because they're pulling as 91 instead of 09).

Is there anything I can do to force it to NOT ignore the leading zero?

View 3 Replies View Related

DateDiff Function - Calculate How Many Days Left Till End Of Contract

May 18, 2013

I am trying to calculate how many days are left till end of contract...

whats wrong with this formula

=DateDiff("d",[Completion_Date], Date())

View 14 Replies View Related

Forms :: Recordset Of Subform Inside Another Subform Which Is Inside A Mainform

Dec 16, 2013

I'm having a problem with the syntax of a recordset of a Datasheet inside a subform which is also inside a Main Form.

Main Form - frm_1_0_LMS
Subform - frm_1_4_0_TeamApprovals
Subform(Datasheet) - frm_1_4_1_TeamApprovalsList

Here is my code:

Code:

Dim rs As DAO.Recordset
Set rs = Forms!frm_1_0_LMS.frm_1_4_0_TeamApprovals.frm_1_4_1_TeamApprovalsList.Form.Recordset
If Not (rs.EOF And rs.BOF) Then
Forms!frm_1_4_2_ApproveDeclineUserLeave.Controls("lblFiledDateLeave").Caption = rs!Leave_Date
End If

I am getting this error: Object doesn't support this property or method

View 1 Replies View Related

Table Comparison

Feb 26, 2006

Is there a way to look at two tables to compare records and add missing records from table to the other?

Thanks!
Terry

View 3 Replies View Related

Comparison Operators.

Apr 27, 2006

I'm having difficulty coming up with a way to exlcuded a group of dates from my Query. I am trying to have a set of dates come up without the dates, between 7/1/2006 and 7/31/2006.

I've tried <> Between #7/1/2006# And #7/31/2006#, and a few others with quotes and such. Any help would be greatly appreciated.

View 1 Replies View Related

Date Comparison

Jun 13, 2005

Hey all,

I've got to show records from a table that are 45 days old or newer.. im not quite sure how to do this in SQL ...

Select field from table where date > (todaysdate-45).. as you can see..clueless lol any help is _greatly_ appreciated

View 3 Replies View Related

Text To Date Comparison

Jan 24, 2007

Hi all- I'm creating an update query.I have a field [dateLastEdit] that is stored as text, I have to compare it to a date entered on a form by user [date_from] (I need to select all dates greater than this) but I'm running into problems:when I use date_from in text or date format and compare it to dateLastEdit in text format the comparison is made in numeric order(so 12/02/2006 is selected as well as 12/02/2005 when date_from is 12/01/2006)SELECT PTSData.LastEditDateFROM PTSDataWHERE (((PTSData.LastEditDate)>=[Forms]![chMgmt_frm]![date_from]));when I use date_from in date format and compare it to dateLastEdit converted to date format I get "expression typed incorrectly or it is too complex to be evaluated" msg.SELECT DateValue([LastEditDate]) AS Expr1FROM PTSDataWHERE (((DateValue([LastEditDate]))>=[Forms]![chMgmt_frm]![date_from]));[LastEditDate]'s format is always mm/dd/yyyy hh:mm:ss, but as text, not date data type.I've tried CDate with same results, isolating it in its own query to test it, using hardwired dates as criteria, but no joy, am I missing something obvious?forgot to add- I've used all the above with left also to select only date portion with same results

View 5 Replies View Related

Values Comparison Query

Nov 20, 2007

I really have looked everywhere

I have 2 fields and I want a query to pull out the records with a lower or equal to quantity value than the stock.

ReorderValue
3
5

Quantity
2
6

As you can see it shuold pick out the top record because its lower, I just need a way of telling it to look at each records Reorder Value

View 8 Replies View Related

DateAdd / Comparison A97 Problem

Feb 8, 2008

I'm running a query to find records over one year old. When I use Date()-"365" or DateAdd (365 days, 12 months, 4 quarters, or 1 year) the records from one year ago today come up just like they are suppose to. The problem comes in when I put the comparison operator out front.

If I put < in front of either Date() or DateAdd minus one year, I get all records from yesterday and earlier as if it is ignoring the year and only looking at the month and day. If I put > in front, I get today's records.

Date() and DateAdd by themselves are working as advertised. Things only get weird when I put < or > out front.

What am I doing wrong?

Thanks,
Forrest

View 2 Replies View Related

Complex Query And Comparison

Aug 9, 2005

I have a scheduling database that my company uses to manage our customers deliveries. We would like to make this database more intelligent by adding some logic and I am not quite sure how to proceed.

On the form frmDelivery, the user inputs all the header information for the delivery, in the subform subfrmLotInfo, they input the houses that will be delivered, the delivery date, and some other miscellaneous information.

When the user inputs the delivery date, the system should count back a number of days based on other criteria and set a build date (when we should start building the cabinets, typically 5 days before the delivery date). Then I need the database to run a query against this date and determine how many boxes we have scheduled to be built already on that day, if it exceed a certain number than I need to it to search an available date close to that date that has not exceeded our production capacity and schedule the lot for that date.

This needs to happen as well if the user changes the delivery date at a later time. Our customers change delivery dates constantly. This will help us schedule our manufacturing plant better and reduce the possiblity of scheduling more than we can actually accomodate.

I have a table tblPrdCapacity that holds how many boxes we can build on a given day. It hold Date, PrdCap (number of boxes). In the subfrmLotInfo, the field BoxesBuilt tells how many boxes will be built for that Lot.

Any info would be greatly appreciated!! I have been tasked to accomplish this as soon as possible.

Thank you!!!

View 3 Replies View Related







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